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
4e8e049a
authored
Aug 29, 2019
by
WEIZIBIN
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
waitting for running thread shutdown before callback thread toStop
parent
59f68132
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 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 @
4e8e049a
...
...
@@ -86,6 +86,11 @@ 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 jobThreadRepository
if
(
jobThreadRepository
.
size
()
>
0
)
{
for
(
Map
.
Entry
<
Integer
,
JobThread
>
item:
jobThreadRepository
.
entrySet
())
{
...
...
@@ -95,6 +100,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