Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
byit-myth-job
Overview
Overview
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
liyuan
byit-myth-job
Commits
1ab2e0d0
Commit
1ab2e0d0
authored
Jun 28, 2020
by
huangfusuper
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
解决重复执行的BUG
parent
6cd48c0f
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
7 deletions
+8
-7
RunNodeServiceImpl.java
...c/main/java/com/byit/service/impl/RunNodeServiceImpl.java
+2
-2
TimeoutExampleThreadRunHelper.java
...com/byit/thread/helper/TimeoutExampleThreadRunHelper.java
+6
-5
No files found.
byit-myth-core/myth-admin-core/src/main/java/com/byit/service/impl/RunNodeServiceImpl.java
View file @
1ab2e0d0
...
...
@@ -82,7 +82,7 @@ public class RunNodeServiceImpl implements RunNodeServer, ApplicationEventPublis
}
else
{
jobTask
.
setTriggerTime
(
node
.
getTriggerNextTime
());
try
{
node
.
setTriggerNextTime
(
new
CronExpression
(
node
.
getNodeCron
()).
getNextValidTimeAfter
(
new
Date
()).
getTime
());
node
.
setTriggerNextTime
(
new
CronExpression
(
node
.
getNodeCron
()).
getNextValidTimeAfter
(
new
Date
(
node
.
getTriggerNextTime
()
)).
getTime
());
}
catch
(
ParseException
e
)
{
e
.
printStackTrace
();
}
...
...
@@ -101,7 +101,7 @@ public class RunNodeServiceImpl implements RunNodeServer, ApplicationEventPublis
jobTaskService
.
saveJobTasks
(
jobTasks
);
log
.
info
(
"-------------【开始修改工作流{}的下次运行时间,以及各种状态】---------------"
,
flow
);
try
{
flow
.
setTriggerNextTime
(
new
CronExpression
(
flow
.
getFlowCron
()).
getNextValidTimeAfter
(
new
Date
()).
getTime
());
flow
.
setTriggerNextTime
(
new
CronExpression
(
flow
.
getFlowCron
()).
getNextValidTimeAfter
(
new
Date
(
flow
.
getTriggerNextTime
()
)).
getTime
());
}
catch
(
ParseException
e
)
{
flow
.
setTriggerNextTime
(
999999999999999999L
);
...
...
byit-myth-core/myth-admin-core/src/main/java/com/byit/thread/helper/TimeoutExampleThreadRunHelper.java
View file @
1ab2e0d0
...
...
@@ -39,7 +39,11 @@ public class TimeoutExampleThreadRunHelper extends BaseThreadRunHelper {
List
<
RunRecording
>
allRunIng
=
runRecordingService
.
findAllRunIng
(
new
FlowConditionDto
());
List
<
RunRecording
>
timeoutRunRecordings
=
allRunIng
.
stream
().
filter
(
runRecording
->
{
long
startTime
=
runRecording
.
getTriggerTime
();
Date
startDate
=
runRecording
.
getStartTime
();
if
(
startDate
==
null
){
return
false
;
}
long
startTime
=
startDate
.
getTime
();
long
thisTime
=
System
.
currentTimeMillis
();
Long
flowTimeout
=
runRecording
.
getFlowTimeout
();
long
time
=
thisTime
-
startTime
;
...
...
@@ -47,10 +51,7 @@ public class TimeoutExampleThreadRunHelper extends BaseThreadRunHelper {
}).
collect
(
Collectors
.
toList
());
if
(
CollectionUtil
.
isNotEmpty
(
timeoutRunRecordings
)){
timeoutRunRecordings
.
forEach
(
timeoutRunRecording
->{
runRecordingAndLogService
.
logAndRunRecordingFailFast
(
timeoutRunRecording
);
});
timeoutRunRecordings
.
forEach
(
runRecordingAndLogService:
:
logAndRunRecordingFailFast
);
}
return
TimeUnit
.
MINUTES
.
toMillis
(
5
);
}
...
...
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