diff options
author | Simon Rettberg | 2019-11-29 16:00:10 +0100 |
---|---|---|
committer | Simon Rettberg | 2019-11-29 16:00:10 +0100 |
commit | 0025b8eb0c68f05eefd4aabb788becc2caae88f8 (patch) | |
tree | eef724d43d5f5d842906c27911383ab94b347076 | |
parent | Increase release timeout from 5 to 10 minutes (diff) | |
download | taskman-lite-0025b8eb0c68f05eefd4aabb788becc2caae88f8.tar.gz taskman-lite-0025b8eb0c68f05eefd4aabb788becc2caae88f8.tar.xz taskman-lite-0025b8eb0c68f05eefd4aabb788becc2caae88f8.zip |
Change thread pool params; allow more concurrent tasks
...and shorten queue
-rw-r--r-- | daemon/src/main/java/org/openslx/taskmanager/main/Taskmanager.java | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/daemon/src/main/java/org/openslx/taskmanager/main/Taskmanager.java b/daemon/src/main/java/org/openslx/taskmanager/main/Taskmanager.java index 8e55e14..7b854c3 100644 --- a/daemon/src/main/java/org/openslx/taskmanager/main/Taskmanager.java +++ b/daemon/src/main/java/org/openslx/taskmanager/main/Taskmanager.java @@ -26,7 +26,8 @@ public class Taskmanager implements FinishCallback, Runnable private static final Logger log = Logger.getLogger( Taskmanager.class ); - private final ThreadPoolExecutor threadPool = new ThreadPoolExecutor( 4, 16, 1, TimeUnit.MINUTES, new ArrayBlockingQueue<Runnable>( 16 ) ); + private final ThreadPoolExecutor threadPool = new ThreadPoolExecutor( 8, 32, 1, TimeUnit.MINUTES, + new ArrayBlockingQueue<Runnable>( 4 ) ); /** * gson object for (de)serialization @@ -45,9 +46,10 @@ public class Taskmanager implements FinishCallback, Runnable private final Semaphore doCheckForWork = new Semaphore( 0 ); - /* - * Static methods - */ + public Taskmanager() + { + threadPool.allowCoreThreadTimeOut( true ); + } /** * Return the status of the task with the given ID. If the task does not |