From 827cc89106af5887d31a18901298db1a07a9eaa8 Mon Sep 17 00:00:00 2001 From: akazankov Date: Thu, 28 Jan 2021 23:26:24 +0300 Subject: [PATCH] zero thread count for empty work-share in SingleThreadStrategy --- .../fix/distributed/job/manager/WorkPoolRunningStrategies.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/distributed-job-manager/src/main/java/ru/fix/distributed/job/manager/WorkPoolRunningStrategies.java b/distributed-job-manager/src/main/java/ru/fix/distributed/job/manager/WorkPoolRunningStrategies.java index 10436935..78293d82 100644 --- a/distributed-job-manager/src/main/java/ru/fix/distributed/job/manager/WorkPoolRunningStrategies.java +++ b/distributed-job-manager/src/main/java/ru/fix/distributed/job/manager/WorkPoolRunningStrategies.java @@ -15,7 +15,7 @@ private WorkPoolRunningStrategies() { @NotNull public static WorkPoolRunningStrategy getSingleThreadStrategy() { - return localWorkPool -> 1; + return localWorkPool -> localWorkPool.isEmpty()? 0 : 1; }