From 5a60d5b78138343bb28586d88823a777b3672a3f Mon Sep 17 00:00:00 2001 From: jay <75509151@qq.com> Date: Mon, 5 Jun 2023 21:04:39 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E4=BB=BB=E5=8A=A1=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/cc/iotkit/ruleengine/task/TaskManager.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/iot-module/iot-rule-engine/src/main/java/cc/iotkit/ruleengine/task/TaskManager.java b/iot-module/iot-rule-engine/src/main/java/cc/iotkit/ruleengine/task/TaskManager.java index bd4d8521..419a90e4 100644 --- a/iot-module/iot-rule-engine/src/main/java/cc/iotkit/ruleengine/task/TaskManager.java +++ b/iot-module/iot-rule-engine/src/main/java/cc/iotkit/ruleengine/task/TaskManager.java @@ -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 tasks = taskInfoData.findAll(); + PageRequest pageRequest = new PageRequest<>(); + pageRequest.setPageNum(idx+=1); + pageRequest.setPageSize(100); + Paging all = taskInfoData.findAll(pageRequest); + List tasks = all.getData(); // 如果记录为空,直接跳出循环 if (CollectionUtil.isEmpty(tasks)) { break;