summaryrefslogtreecommitdiffstats
path: root/cps-service/src
diff options
context:
space:
mode:
Diffstat (limited to 'cps-service/src')
-rw-r--r--cps-service/src/main/java/org/onap/cps/config/AsyncConfig.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/cps-service/src/main/java/org/onap/cps/config/AsyncConfig.java b/cps-service/src/main/java/org/onap/cps/config/AsyncConfig.java
index 2d8f7fb08b..9327c53451 100644
--- a/cps-service/src/main/java/org/onap/cps/config/AsyncConfig.java
+++ b/cps-service/src/main/java/org/onap/cps/config/AsyncConfig.java
@@ -21,6 +21,7 @@
package org.onap.cps.config;
+import java.util.concurrent.ThreadPoolExecutor;
import javax.validation.constraints.Min;
import lombok.Setter;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
@@ -61,7 +62,10 @@ public class AsyncConfig {
executor.setMaxPoolSize(maxPoolSize);
executor.setQueueCapacity(queueCapacity);
executor.setWaitForTasksToCompleteOnShutdown(waitForTasksToCompleteOnShutdown);
+ executor.setKeepAliveSeconds(60);
executor.setThreadNamePrefix(threadNamePrefix);
+ executor.setRejectedExecutionHandler(new ThreadPoolExecutor.DiscardPolicy());
+ executor.initialize();
return executor;
}