Commit 9fac0731 by huangfusuper

分布式锁

parent 7500136b
...@@ -42,13 +42,11 @@ public class DaemonScanThreadRunHelperRedisLock extends BaseDaemonScanThreadRunH ...@@ -42,13 +42,11 @@ public class DaemonScanThreadRunHelperRedisLock extends BaseDaemonScanThreadRunH
Long sleepTime = 0L; Long sleepTime = 0L;
try{ try{
//加锁 60秒后超时 //加锁 60秒后超时
if (RedissLockUtil.trlock(lockName, TimeUnit.SECONDS, 30)) { if (RedissLockUtil.trlock(lockName, TimeUnit.SECONDS, 59)) {
log.debug("------------{},加锁成功,锁名称为{}----------",threadName,lockName); log.debug("------------{},加锁成功,锁名称为{}----------",threadName,lockName);
dateAligned(CYCLE_INTERVAL,threadName); dateAligned(CYCLE_INTERVAL,threadName);
//调用业务操作 //调用业务操作
sleepTime = examplesValue.start(); sleepTime = examplesValue.start();
}else {
log.debug("------------{},加锁失败,锁名称为{}----------",threadName,lockName);
} }
}catch (Exception e) { }catch (Exception e) {
if(!THREAD_GROUP_STOP){ if(!THREAD_GROUP_STOP){
......
...@@ -110,6 +110,7 @@ public class RunRecordingServiceImpl implements RunRecordingService { ...@@ -110,6 +110,7 @@ public class RunRecordingServiceImpl implements RunRecordingService {
//判断当前的实例 中是否有 未完成的 //判断当前的实例 中是否有 未完成的
if (RunRecordingEnum.FLOW_STATUS_RUN_ING.getCode().equals(runRecording.getFlowStatus()) || if (RunRecordingEnum.FLOW_STATUS_RUN_ING.getCode().equals(runRecording.getFlowStatus()) ||
RunRecordingEnum.FLOW_STATUS_IS_STOP.getCode().equals(runRecording.getFlowStatus())) { RunRecordingEnum.FLOW_STATUS_IS_STOP.getCode().equals(runRecording.getFlowStatus())) {
log.info("----------{}实例正在运行中--------",runRecording);
return true; return true;
} }
} }
......
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