summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Rettberg2019-11-29 16:00:10 +0100
committerSimon Rettberg2019-11-29 16:00:10 +0100
commit0025b8eb0c68f05eefd4aabb788becc2caae88f8 (patch)
treeeef724d43d5f5d842906c27911383ab94b347076
parentIncrease release timeout from 5 to 10 minutes (diff)
downloadtaskman-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.java10
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