Commit c50ffe7e by huangfusuper

工作流扫描线程重构

parent 9331f0cd
...@@ -24,6 +24,7 @@ import java.util.concurrent.TimeUnit; ...@@ -24,6 +24,7 @@ import java.util.concurrent.TimeUnit;
*/ */
@Component @Component
@Slf4j @Slf4j
@Deprecated
public class FlowScanHelper { public class FlowScanHelper {
private final Long PRE_TEST_TIME = System.currentTimeMillis()+TimeUnit.HOURS.toMillis(30); private final Long PRE_TEST_TIME = System.currentTimeMillis()+TimeUnit.HOURS.toMillis(30);
private final FlowService flowService; private final FlowService flowService;
......
...@@ -24,7 +24,6 @@ import java.util.concurrent.TimeUnit; ...@@ -24,7 +24,6 @@ import java.util.concurrent.TimeUnit;
@Component @Component
@Slf4j @Slf4j
public class FlowThreadRunHelper extends BaseThreadRunHelper { public class FlowThreadRunHelper extends BaseThreadRunHelper {
private final Long PRE_TEST_TIME = System.currentTimeMillis()+ TimeUnit.HOURS.toMillis(30);
private static final String LOCK_NAME = "flow_lock"; private static final String LOCK_NAME = "flow_lock";
private final DataSource dataSource; private final DataSource dataSource;
...@@ -40,10 +39,10 @@ public class FlowThreadRunHelper extends BaseThreadRunHelper { ...@@ -40,10 +39,10 @@ public class FlowThreadRunHelper extends BaseThreadRunHelper {
} }
@Override @Override
public boolean start() { public Long start() {
boolean isSleep = false; Long preTestTime = System.currentTimeMillis()+ TimeUnit.HOURS.toMillis(30);
//这个查询时有一个条件是 剩余次数不等于0也就是说 等于0的就查询不出来 //这个查询时有一个条件是 剩余次数不等于0也就是说 等于0的就查询不出来
List<Flow> halfAnHourFlow = flowService.findHalfAnHourFlow(PRE_TEST_TIME); List<Flow> halfAnHourFlow = flowService.findHalfAnHourFlow(preTestTime);
if (CollectionUtil.isNotEmpty(halfAnHourFlow)) { if (CollectionUtil.isNotEmpty(halfAnHourFlow)) {
for(Flow flow : halfAnHourFlow ){ for(Flow flow : halfAnHourFlow ){
log.debug("-----------------【工作流{}的执行次数大于0,放行】-------------------------",flow.getFlowName()); log.debug("-----------------【工作流{}的执行次数大于0,放行】-------------------------",flow.getFlowName());
...@@ -71,9 +70,9 @@ public class FlowThreadRunHelper extends BaseThreadRunHelper { ...@@ -71,9 +70,9 @@ public class FlowThreadRunHelper extends BaseThreadRunHelper {
} }
} }
}else{ }else{
isSleep = true; return UNIVERSAL_WAIT_TIME;
} }
return isSleep; return NOT_WAIT_TIME;
} }
@Override @Override
......
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