Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yanxuan-qc-change-system
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
yx-qc-change-flow
yanxuan-qc-change-system
Commits
2a1df136
Commit
2a1df136
authored
Feb 08, 2023
by
“zcwang”
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modify: 执行节点邮件接收优化
parent
811b9dd3
Pipeline
#45046
passed with stages
in 1 minute 39 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
64 additions
and
2 deletions
+64
-2
AsyncBuildConfig.java
...ease/mail/yanxuan/change/biz/config/AsyncBuildConfig.java
+31
-0
AsyncEmailConfig.java
...ease/mail/yanxuan/change/biz/config/AsyncEmailConfig.java
+31
-0
BuildAndSendEmailImpl.java
...anxuan/change/biz/service/impl/BuildAndSendEmailImpl.java
+2
-2
No files found.
yanxuan-qc-change-system-biz/src/main/java/com/netease/mail/yanxuan/change/biz/config/AsyncBuildConfig.java
0 → 100644
View file @
2a1df136
/**
* @(#)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
yanxuan-qc-change-system-biz/src/main/java/com/netease/mail/yanxuan/change/biz/config/AsyncEmailConfig.java
0 → 100644
View file @
2a1df136
/**
* @(#)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
yanxuan-qc-change-system-biz/src/main/java/com/netease/mail/yanxuan/change/biz/service/impl/BuildAndSendEmailImpl.java
View file @
2a1df136
...
...
@@ -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
());
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment