diff options
Diffstat (limited to 'cps-service/src')
-rw-r--r-- | cps-service/src/main/java/org/onap/cps/config/AsyncConfig.java | 4 |
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 2d8f7fb08..9327c5345 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; } |