Commit 2a1df136 by “zcwang”

modify: 执行节点邮件接收优化

parent 811b9dd3
Pipeline #45046 passed with stages
in 1 minute 39 seconds
/**
* @(#)AsyncBuildConfig.java, 2023/2/8.
* <p/>
* Copyright 2023 Netease, Inc. All rights reserved.
* NETEASE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*/
package com.netease.mail.yanxuan.change.biz.config;
import java.util.concurrent.Executor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
/**
* @Author zcwang
* @Date 2023/2/8
*/
@Configuration
public class AsyncBuildConfig {
@Bean(name = "asyncBuild")
public Executor getAsyncExecutor() {
ThreadPoolTaskExecutor taskExecutor = new ThreadPoolTaskExecutor();
taskExecutor.setCorePoolSize(5);
taskExecutor.setMaxPoolSize(10);
taskExecutor.setThreadNamePrefix("asyncBuild-");
taskExecutor.initialize();
return taskExecutor;
}
}
\ No newline at end of file
/**
* @(#)AsyncEmailConfig.java, 2023/2/8.
* <p/>
* Copyright 2023 Netease, Inc. All rights reserved.
* NETEASE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*/
package com.netease.mail.yanxuan.change.biz.config;
import java.util.concurrent.Executor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
/**
* @Author zcwang
* @Date 2023/2/8
*/
@Configuration
public class AsyncEmailConfig {
@Bean(name = "asyncEmail")
public Executor getAsyncExecutor() {
ThreadPoolTaskExecutor taskExecutor = new ThreadPoolTaskExecutor();
taskExecutor.setCorePoolSize(5);
taskExecutor.setMaxPoolSize(10);
taskExecutor.setThreadNamePrefix("asyncEmail-");
taskExecutor.initialize();
return taskExecutor;
}
}
\ No newline at end of file
......@@ -66,7 +66,7 @@ public class BuildAndSendEmailImpl implements BuildAndSendEmail {
private ChangeConfigService changeConfigService;
@Override
@Async
@Async("asyncBuild")
public void buildAndSendEmailCreate(ChangeRecord changeRecord, List<ChangeExecRecord> changeExecRecords, StringBuilder changeType, String changeCommander, ChangeFlowCreateReq changeFlowCreateReq) {
HashMap<String, Object> param = new HashMap<>();
param.put("changeId", changeRecord.getFlowId());
......@@ -134,7 +134,7 @@ public class BuildAndSendEmailImpl implements BuildAndSendEmail {
}
@Override
@Async
@Async("asyncBuild")
public void buildAndSendEmailSubmit(ChangeRecord changeRecord, List<ChangeExecRecord> changeExecRecords) {
HashMap<String, Object> param = new HashMap<>();
param.put("changeId", changeRecord.getFlowId());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment