1
This commit is contained in:
@@ -2,6 +2,7 @@ package cn.van.business.config;
|
||||
|
||||
import org.springframework.aop.interceptor.AsyncUncaughtExceptionHandler;
|
||||
import org.springframework.aop.interceptor.SimpleAsyncUncaughtExceptionHandler;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.scheduling.annotation.AsyncConfigurer;
|
||||
import org.springframework.scheduling.annotation.EnableAsync;
|
||||
@@ -20,7 +21,7 @@ import java.util.concurrent.ThreadPoolExecutor;
|
||||
@EnableAsync
|
||||
public class AsyncConfig implements AsyncConfigurer {
|
||||
|
||||
@Override
|
||||
@Bean(name = "threadPoolTaskExecutor")
|
||||
public Executor getAsyncExecutor() {
|
||||
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
|
||||
executor.setCorePoolSize(10); // 核心线程数
|
||||
|
||||
@@ -32,7 +32,7 @@ public class OrderUtil {
|
||||
/**
|
||||
* 手动调用 将订单发送到微信
|
||||
*/
|
||||
@Async
|
||||
@Async("threadPoolTaskExecutor")
|
||||
public void orderToWx(OrderRow orderRow, Boolean isAutoFlush) {
|
||||
// 获取订单当前状态
|
||||
Integer newValidCode = orderRow.getValidCode();
|
||||
|
||||
Reference in New Issue
Block a user