Commit b2db90a4 by huangfusuper

暂时性解决分布式锁失效的状态

parent 8331bd3c
......@@ -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();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment