Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
sts网站
Project
Project
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
liyang
sts网站
Commits
9e51d3f2
Commit
9e51d3f2
authored
Jan 14, 2022
by
mingliangyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化任务队列满时任务拒绝策略
parent
d7ca248b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
5 deletions
+7
-5
ThreadPoolConfig.java
...ain/java/com/ruoyi/framework/config/ThreadPoolConfig.java
+7
-5
No files found.
ruoyi-framework/src/main/java/com/ruoyi/framework/config/ThreadPoolConfig.java
View file @
9e51d3f2
package
com
.
ruoyi
.
framework
.
config
;
package
com
.
ruoyi
.
framework
.
config
;
import
java.util.concurrent.ScheduledExecutorService
;
import
com.ruoyi.common.utils.Threads
;
import
java.util.concurrent.ScheduledThreadPoolExecutor
;
import
java.util.concurrent.ThreadPoolExecutor
;
import
org.apache.commons.lang3.concurrent.BasicThreadFactory
;
import
org.apache.commons.lang3.concurrent.BasicThreadFactory
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor
;
import
org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor
;
import
com.ruoyi.common.utils.Threads
;
import
java.util.concurrent.ScheduledExecutorService
;
import
java.util.concurrent.ScheduledThreadPoolExecutor
;
import
java.util.concurrent.ThreadPoolExecutor
;
/**
/**
* 线程池配置
* 线程池配置
...
@@ -49,7 +50,8 @@ public class ThreadPoolConfig
...
@@ -49,7 +50,8 @@ public class ThreadPoolConfig
protected
ScheduledExecutorService
scheduledExecutorService
()
protected
ScheduledExecutorService
scheduledExecutorService
()
{
{
return
new
ScheduledThreadPoolExecutor
(
corePoolSize
,
return
new
ScheduledThreadPoolExecutor
(
corePoolSize
,
new
BasicThreadFactory
.
Builder
().
namingPattern
(
"schedule-pool-%d"
).
daemon
(
true
).
build
())
new
BasicThreadFactory
.
Builder
().
namingPattern
(
"schedule-pool-%d"
).
daemon
(
true
).
build
(),
new
ThreadPoolExecutor
.
CallerRunsPolicy
())
{
{
@Override
@Override
protected
void
afterExecute
(
Runnable
r
,
Throwable
t
)
protected
void
afterExecute
(
Runnable
r
,
Throwable
t
)
...
...
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