From 8853292babb2ad94de4a3207966f1e83b767cd2d Mon Sep 17 00:00:00 2001
From: zhongrj <646384940@qq.com>
Date: Sun, 17 Sep 2023 16:38:34 +0800
Subject: [PATCH] 新增流程节点进程查询接口

---
 src/main/java/org/springblade/common/config/AsyncConfig.java |   15 ++++++++++-----
 1 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/src/main/java/org/springblade/common/config/AsyncConfig.java b/src/main/java/org/springblade/common/config/AsyncConfig.java
index f9e864e..41dc362 100644
--- a/src/main/java/org/springblade/common/config/AsyncConfig.java
+++ b/src/main/java/org/springblade/common/config/AsyncConfig.java
@@ -1,10 +1,14 @@
 package org.springblade.common.config;
 
+import org.springframework.aop.interceptor.AsyncUncaughtExceptionHandler;
 import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
 import org.springframework.core.task.TaskExecutor;
+import org.springframework.scheduling.annotation.AsyncConfigurer;
 import org.springframework.scheduling.annotation.EnableAsync;
 import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
 
+import java.util.concurrent.Executor;
 import java.util.concurrent.ThreadPoolExecutor;
 
 /**
@@ -13,21 +17,22 @@
  * @since 2022-02-22
  */
 @EnableAsync
-public class AsyncConfig {
+public class AsyncConfig{
 
 	@Bean
-	public TaskExecutor executor(){
+	public Executor getAsyncExecutor() {
 		ThreadPoolTaskExecutor executor=new ThreadPoolTaskExecutor();
 		//核心线程数
-		executor.setCorePoolSize(10);
+		executor.setCorePoolSize(4);
 		//最大线程数
-		executor.setMaxPoolSize(20);
+		executor.setMaxPoolSize(6);
 		//队列大小
 		executor.setQueueCapacity(1000);
 		//线程最大空闲时间
 		executor.setKeepAliveSeconds(300);
-		executor.setThreadNamePrefix("fsx-Executor-");
 		//指定用于新创建的线程名称的前缀。
+		executor.setThreadNamePrefix("fsx-Executor-");
+		//设置拒绝策略  CallerRunsPolicy 由调用的线程来处理这个任务
 		executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
 		//返回
 		return executor;

--
Gitblit v1.9.3