From fb9cd5968346045e1129406ca54639075316a396 Mon Sep 17 00:00:00 2001 From: James Moger Date: Thu, 29 May 2014 12:40:35 -0400 Subject: [PATCH] Add setting to control thread pool size for default work queue --- releases.moxie | 2 ++ src/main/distrib/data/gitblit.properties | 6 ++++++ src/main/java/com/gitblit/manager/ServicesManager.java | 3 ++- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/releases.moxie b/releases.moxie index 34f855bc..4332238d 100644 --- a/releases.moxie +++ b/releases.moxie @@ -38,6 +38,7 @@ r24: { - Add setting to allow STARTTLS without requiring SMTPS (pr-183) - Added an extension point for monitoring onStartup and onShutdown (ticket-79) - Tag server-side merges when incremental push tags are enabled (issue-432, ticket-85) + - Add setting to control default thread pool size for miscellaneous background tasks (ticket-92) dependencyChanges: - Update to javax.mail 1.5.1 (issue-417, ticket-58) contributors: @@ -53,6 +54,7 @@ r24: { settings: - { name: 'web.allowDeletingNonEmptyRepositories', defaultValue: 'true' } - { name: 'mail.starttls', defaultValue: 'false' } + - { name: 'execution.defaultThreadPoolSize', defaultValue: '1' } } # diff --git a/src/main/distrib/data/gitblit.properties b/src/main/distrib/data/gitblit.properties index 7d74c281..b27395c3 100644 --- a/src/main/distrib/data/gitblit.properties +++ b/src/main/distrib/data/gitblit.properties @@ -613,6 +613,12 @@ plugins.folder = ${baseFolder}/plugins # SINCE 1.5.0 plugins.registry = http://plugins.gitblit.com/plugins.json +# Number of threads used to handle miscellaneous tasks in the background. +# +# SINCE 1.6.0 +# RESTART REQUIRED +execution.defaultThreadPoolSize = 1 + # # Groovy Integration # diff --git a/src/main/java/com/gitblit/manager/ServicesManager.java b/src/main/java/com/gitblit/manager/ServicesManager.java index b1c97ba4..755d8bac 100644 --- a/src/main/java/com/gitblit/manager/ServicesManager.java +++ b/src/main/java/com/gitblit/manager/ServicesManager.java @@ -80,8 +80,9 @@ public class ServicesManager implements IManager { public ServicesManager(IGitblit gitblit) { this.settings = gitblit.getSettings(); this.gitblit = gitblit; + int defaultThreadPoolSize = settings.getInteger(Keys.execution.defaultThreadPoolSize, 1); this.idGenerator = new IdGenerator(); - this.workQueue = new WorkQueue(idGenerator, 1); + this.workQueue = new WorkQueue(idGenerator, defaultThreadPoolSize); } @Override -- 2.39.5