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
b2db90a4
Commit
b2db90a4
authored
May 23, 2020
by
huangfusuper
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
暂时性解决分布式锁失效的状态
parent
8331bd3c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
MakeUpFlowThreadRunHelper.java
...ava/com/byit/thread/helper/MakeUpFlowThreadRunHelper.java
+3
-2
No files found.
byit-myth-core/myth-admin-core/src/main/java/com/byit/thread/helper/MakeUpFlowThreadRunHelper.java
View file @
b2db90a4
...
...
@@ -13,6 +13,7 @@ import javax.sql.DataSource;
import
java.util.Comparator
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Random
;
import
java.util.concurrent.TimeUnit
;
import
java.util.function.BinaryOperator
;
import
java.util.function.Function
;
...
...
@@ -57,11 +58,11 @@ public class MakeUpFlowThreadRunHelper extends BaseThreadRunHelper {
Map
<
Integer
,
WaitingRecord
>
nextRunFlow
=
allByTriggerTime
.
stream
()
.
collect
(
Collectors
.
toMap
(
WaitingRecord:
:
getFlowId
,
Function
.
identity
(),
BinaryOperator
.
minBy
(
Comparator
.
comparingInt
(
WaitingRecord:
:
getWaitOrder
))));
Random
random
=
new
Random
();
nextRunFlow
.
forEach
((
key
,
value
)
->{
/*保证数据为串行*/
try
{
Thread
.
sleep
(
100
);
Thread
.
sleep
(
random
.
nextInt
(
101
)+
100
);
}
catch
(
InterruptedException
e
)
{
e
.
printStackTrace
();
}
...
...
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