]> source.dussan.org Git - gitblit.git/commitdiff
Add setting to control thread pool size for default work queue 92/92/1
authorJames Moger <james.moger@gitblit.com>
Thu, 29 May 2014 16:40:35 +0000 (12:40 -0400)
committerJames Moger <james.moger@gitblit.com>
Thu, 29 May 2014 16:40:35 +0000 (12:40 -0400)
releases.moxie
src/main/distrib/data/gitblit.properties
src/main/java/com/gitblit/manager/ServicesManager.java

index 34f855bce74481dfbed5698883517320ca5934f2..4332238d94497e35229d9e988f9b6f5c94baae96 100644 (file)
@@ -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' }
 }
 
 #
index 7d74c2812951cf349a1f805646ed563a09ec6441..b27395c3bc28bab98b24d99f869fdc9a31157c07 100644 (file)
@@ -613,6 +613,12 @@ plugins.folder = ${baseFolder}/plugins
 # SINCE 1.5.0\r
 plugins.registry = http://plugins.gitblit.com/plugins.json\r
 \r
+# Number of threads used to handle miscellaneous tasks in the background.\r
+#\r
+# SINCE 1.6.0\r
+# RESTART REQUIRED\r
+execution.defaultThreadPoolSize = 1\r
+\r
 #\r
 # Groovy Integration\r
 #\r
index b1c97ba4b1c5b391b8ad7066e66e3c6bd0ab150f..755d8bacdf026d92da1e5c960da2298edfc6f668 100644 (file)
@@ -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