fix 任务管理

V0.5.x
jay 2023-06-05 21:04:39 +08:00
parent 256df1b0a5
commit 5a60d5b781
1 changed files with 6 additions and 1 deletions

View File

@ -9,6 +9,7 @@
*/
package cc.iotkit.ruleengine.task;
import cc.iotkit.common.api.PageRequest;
import cc.iotkit.common.enums.ErrCode;
import cc.iotkit.common.exception.BizException;
import cc.iotkit.data.manager.ITaskInfoData;
@ -54,7 +55,11 @@ public class TaskManager implements ApplicationContextAware {
public void initTask() {
int idx = 1;
while (true) {
List<TaskInfo> tasks = taskInfoData.findAll();
PageRequest<TaskInfo> pageRequest = new PageRequest<>();
pageRequest.setPageNum(idx+=1);
pageRequest.setPageSize(100);
Paging<TaskInfo> all = taskInfoData.findAll(pageRequest);
List<TaskInfo> tasks = all.getData();
// 如果记录为空,直接跳出循环
if (CollectionUtil.isEmpty(tasks)) {
break;