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
b09520b8
authored
May 22, 2019
by
xuxueli
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
update document
parent
19d1ac2e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
6 deletions
xxl-job-admin/src/main/java/com/xxl/job/admin/core/thread/JobScheduleHelper.java
xxl-job-admin/src/main/java/com/xxl/job/admin/core/thread/JobScheduleHelper.java
View file @
b09520b8
...
...
@@ -36,13 +36,16 @@ public class JobScheduleHelper {
scheduleThread
=
new
Thread
(
new
Runnable
()
{
@Override
public
void
run
()
{
while
(!
toStop
)
{
// 随机休眠1s内
try
{
TimeUnit
.
MILLISECONDS
.
sleep
(
500
+
new
Random
().
nextInt
(
500
));
}
catch
(
InterruptedException
e
)
{
try
{
TimeUnit
.
MILLISECONDS
.
sleep
(
5000
);
}
catch
(
InterruptedException
e
)
{
if
(!
toStop
)
{
logger
.
error
(
e
.
getMessage
(),
e
);
}
}
while
(!
toStop
)
{
// 匹配任务
Connection
conn
=
null
;
...
...
@@ -139,6 +142,16 @@ public class JobScheduleHelper {
}
}
}
// 随机休眠1s内
try
{
TimeUnit
.
MILLISECONDS
.
sleep
(
500
+
new
Random
().
nextInt
(
500
));
}
catch
(
InterruptedException
e
)
{
if
(!
toStop
)
{
logger
.
error
(
e
.
getMessage
(),
e
);
}
}
}
logger
.
info
(
">>>>>>>>>>> xxl-job, JobScheduleHelper#scheduleThread stop"
);
}
...
...
@@ -154,6 +167,7 @@ public class JobScheduleHelper {
public
void
run
()
{
int
lastSecond
=
-
1
;
while
(!
toStop
)
{
try
{
// second data
List
<
Integer
>
ringItemData
=
new
ArrayList
<>();
...
...
@@ -195,7 +209,9 @@ public class JobScheduleHelper {
try
{
TimeUnit
.
SECONDS
.
sleep
(
1
);
}
catch
(
InterruptedException
e
)
{
logger
.
error
(
e
.
getMessage
(),
e
);
if
(!
toStop
)
{
logger
.
error
(
e
.
getMessage
(),
e
);
}
}
}
logger
.
info
(
">>>>>>>>>>> xxl-job, JobScheduleHelper#ringThread stop"
);
...
...
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