Merge pull request !5 from 削梨非DAO/master
V0.5.x
xiwa 2022-09-21 04:00:57 +00:00 committed by Gitee
commit 48f98e1595
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 10 additions and 8 deletions

View File

@ -60,9 +60,13 @@ public class RuleManager {
@SneakyThrows
public void initRules() {
int idx = 0;
int idx = 1;
while (true) {
Paging<RuleInfo> rules = ruleInfoData.findAll(idx, 1000);
// 如果记录为空,直接跳出循环
if (rules.getData() == null || rules.getData().isEmpty()) {
break;
}
rules.getData().forEach(rule -> {
try {
//不添加停止的规则
@ -76,9 +80,6 @@ public class RuleManager {
}
});
idx++;
if (rules.getTotal() == 0) {
break;
}
}
}

View File

@ -48,9 +48,13 @@ public class TaskManager implements ApplicationContextAware {
}
public void initTask() {
int idx = 0;
int idx = 1;
while (true) {
Paging<TaskInfo> tasks = taskInfoData.findAll(idx, 1000);
// 如果记录为空,直接跳出循环
if (tasks.getData() == null || tasks.getData().isEmpty()) {
break;
}
tasks.getData().forEach(task -> {
try {
if (!TaskInfo.STATE_RUNNING.equals(task.getState())) {
@ -63,9 +67,6 @@ public class TaskManager implements ApplicationContextAware {
}
});
idx++;
if (tasks.getTotal() == 0) {
break;
}
}
}