Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
熊鹏飞
/
xxljob220
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
ebe88bd7
authored
Mar 28, 2020
by
许雪里
Committed by
GitHub
Mar 28, 2020
Browse files
Options
_('Browse Files')
Download
Plain Diff
Merge pull request #1104 from WEIZIBIN/fix_graceful_shutdown_callback_lose
修复优雅停机时,中断线程后,任务状态没有同步到admin
parents
8c73afa2
35bceaac
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
0 deletions
xxl-job-core/src/main/java/com/xxl/job/core/executor/XxlJobExecutor.java
xxl-job-core/src/main/java/com/xxl/job/core/executor/XxlJobExecutor.java
View file @
ebe88bd7
...
...
@@ -84,6 +84,12 @@ public class XxlJobExecutor {
initRpcProvider
(
ip
,
port
,
appName
,
accessToken
);
}
public
void
destroy
(){
List
<
JobThread
>
runningThreads
=
new
ArrayList
<>(
jobThreadRepository
.
values
());
if
(
logger
.
isInfoEnabled
())
{
logger
.
info
(
"running threads {}"
,
runningThreads
);
}
// destory executor-server
stopRpcProvider
();
...
...
@@ -96,6 +102,15 @@ public class XxlJobExecutor {
}
jobHandlerRepository
.
clear
();
for
(
JobThread
runningThread
:
runningThreads
)
{
try
{
// wait for all job thread push result to callback queue
runningThread
.
join
();
}
catch
(
InterruptedException
e
)
{
logger
.
warn
(
"interrupted while stopping {}"
,
runningThread
);
break
;
}
}
// destory JobLogFileCleanThread
JobLogFileCleanThread
.
getInstance
().
toStop
();
...
...
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