Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
X
xyqb-user2
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
head_group
xyqb-user2
Commits
89fe023e
Commit
89fe023e
authored
May 23, 2018
by
xiaoguang.xu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix : 去掉无用的async thread
parent
67fd8d7e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
53 deletions
+0
-53
AsyncConfig.java
...in/java/cn/quantgroup/xyqb/config/thread/AsyncConfig.java
+0
-53
No files found.
src/main/java/cn/quantgroup/xyqb/config/thread/AsyncConfig.java
deleted
100644 → 0
View file @
67fd8d7e
package
cn
.
quantgroup
.
xyqb
.
config
.
thread
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.scheduling.annotation.EnableAsync
;
import
org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor
;
import
java.util.concurrent.Executor
;
/**
* Created by xuran on 2017/11/8.
*/
@Configuration
@EnableAsync
public
class
AsyncConfig
{
/**
* 生成线程池
*
* @param corePoolSize
* @param maxPoolSize
* @param queueCapacity
* @param waitForCompleteOnShutdown
* @param prefix
* @return
*/
private
ThreadPoolTaskExecutor
generateThreadPoolTaskExecutor
(
int
corePoolSize
,
int
maxPoolSize
,
int
queueCapacity
,
boolean
waitForCompleteOnShutdown
,
int
keepAliveSeconds
,
boolean
allowCoreThreadTimeOut
,
String
prefix
)
{
ThreadPoolTaskExecutor
executor
=
new
ThreadPoolTaskExecutor
();
executor
.
setCorePoolSize
(
corePoolSize
);
executor
.
setMaxPoolSize
(
maxPoolSize
);
executor
.
setQueueCapacity
(
queueCapacity
);
executor
.
setKeepAliveSeconds
(
keepAliveSeconds
);
executor
.
setAllowCoreThreadTimeOut
(
allowCoreThreadTimeOut
);
executor
.
setWaitForTasksToCompleteOnShutdown
(
waitForCompleteOnShutdown
);
executor
.
setThreadNamePrefix
(
prefix
);
executor
.
initialize
();
return
executor
;
}
/**
* 日志线程池
*
* @return
*/
@Bean
(
name
=
"logExecutor"
)
public
Executor
loanMqExecutor
()
{
return
generateThreadPoolTaskExecutor
(
100
,
2000
,
2000
,
true
,
30
,
true
,
"loanMqExecutor-"
);
}
}
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