代码整理4

20230922-ljl-fixBug
qiushengjie 1 year ago
parent 40f0e2e1b7
commit f2d9836c1f

@ -15,10 +15,6 @@ public abstract class TaskBaseService implements TaskHandler {
@Autowired
private PlatformTransactionManager transactionManager;
@Getter
protected boolean isCirculate = false;
@Getter
protected int intervalTimeSecond = 2;
@Getter
protected int corePoolSiz = 4;
@Getter
protected int maxPoolSize = 10000;
@ -39,25 +35,16 @@ public abstract class TaskBaseService implements TaskHandler {
}
public void runTask() {
while (isCirculate()) {
try {
setLogId();
if (isPoolFull()) {
return;
}
execute();
} catch (MSException e){
log.info(e.getMessage());
} catch (Throwable e) {
log.error("任务异常退出, 任务池 " + getTaskExecutorName(), e);
}
try {
Thread.sleep(getIntervalTimeSecond());
} catch (Throwable e) {
log.error("循环间隔异常");
try {
setLogId();
if (isPoolFull()) {
return;
}
log.info("进入下一次循环");
execute();
} catch (MSException e){
log.info(e.getMessage());
} catch (Throwable e) {
log.error("任务异常退出, 任务池 " + getTaskExecutorName(), e);
}
}

@ -69,10 +69,6 @@ public class CheckAuditStatusTimeoutTaskService extends TaskBaseService {
return taskPool;
}
public boolean isCirculate() {return true;}
public int getIntervalTimeSecond() {return 2;}
@Async("checkAuditStatusTimeoutTaskPool")
@Scheduled(fixedRate = 10000)
@Override

@ -41,10 +41,6 @@ public class CheckMaterialBizWaitTaskService extends TaskBaseService {
return 5;
}
public boolean isCirculate() {return true;}
public int getIntervalTimeSecond() {return 2;}
/**
*
*/

@ -65,10 +65,6 @@ public class MoveMaterialAuditProcessTaskService extends TaskBaseService {
return 30;
}
public boolean isCirculate() {return true;}
public int getIntervalTimeSecond() {return 1;}
/**
*
*/

@ -59,10 +59,6 @@ public class MoveMaterialBizProcessTaskService extends TaskBaseService {
return 5;
}
public boolean isCirculate() {return true;}
public int getIntervalTimeSecond() {return 2;}
/**
*
*/

@ -103,6 +103,10 @@ public class MovePublishBufferTaskService extends TaskBaseService {
Map<Long, Integer> selectedShopMap = (Map<Long, Integer>) params;
log.info("start moveProductPublishBufferToQueue");
Map<Long, Integer> shopBufferCountMap = moveProductPublishBufferToQueue(selectedShopMap);
if (ObjectUtil.isEmpty(shopBufferCountMap)) {
log.info("end moveProductPublishBufferToQueue for empty bufferRows cost times");
return null;
}
log.info("end moveProductPublishBufferToQueue ret: " + shopBufferCountMap.toString());
return shopBufferCountMap;
}

@ -35,10 +35,6 @@ public class MoveUnlockTaskService extends TaskBaseService {
return 3;
}
public boolean isCirculate() {return true;}
public int getIntervalTimeSecond() {return 2;}
/**
*
*/

@ -122,10 +122,6 @@ public class ProcessMovePublishToPicTaskService extends TaskBaseService {
return 5;
}
public boolean isCirculate() {return true;}
public int getIntervalTimeSecond() {return 2;}
/**
*
*/

@ -135,10 +135,6 @@ public class ProcessProductPublishTaskService extends TaskBaseService {
return 5;
}
public boolean isCirculate() {return true;}
public int getIntervalTimeSecond() {return 2;}
/**
*
*/

Loading…
Cancel
Save