diff --git a/ai-analytic-center-biz/src/main/java/com/volvo/ai/analytic/center/config/ExecutorConfig.java b/ai-analytic-center-biz/src/main/java/com/volvo/ai/analytic/center/config/ExecutorConfig.java index 1623eed..ddb1c60 100644 --- a/ai-analytic-center-biz/src/main/java/com/volvo/ai/analytic/center/config/ExecutorConfig.java +++ b/ai-analytic-center-biz/src/main/java/com/volvo/ai/analytic/center/config/ExecutorConfig.java @@ -30,7 +30,7 @@ public class ExecutorConfig { @Bean("threadPoolTaskExecutor") @Primary public ThreadPoolTaskExecutor corpusProcessExecutor() { - ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor(); + executor = new ThreadPoolTaskExecutor(); executor.setCorePoolSize(corePoolSize); executor.setMaxPoolSize(maxPoolSize); executor.setQueueCapacity(queueCapacity); @@ -38,14 +38,13 @@ public class ExecutorConfig { executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy()); executor.setKeepAliveSeconds(keepAliveSeconds); executor.initialize(); - this.executor = executor; return executor; } @PreDestroy public void destroy() { if (executor != null) { - log.info("Shutting down thread pool: {}", executor); + log.info("Thread-process-pool-ShuttingDown: {}", executor); ThreadPoolExecutor threadPoolExecutor = this.executor.getThreadPoolExecutor(); threadPoolExecutor.shutdownNow(); // 强制关闭所有正在执行的任务 }