Commit c50ffe7e by huangfusuper

工作流扫描线程重构

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