Skip to content

Commit

Permalink
Fix delay execution task will never be dispatched
Browse files Browse the repository at this point in the history
  • Loading branch information
ruanwenjun committed Mar 21, 2024
1 parent 023c22c commit 8354eea
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Expand Up @@ -69,7 +69,7 @@ public void run() {
defaultTaskExecuteRunnable = globalTaskDispatchWaitingQueue.takeTaskExecuteRunnable();
try {
TaskExecutionStatus status = defaultTaskExecuteRunnable.getTaskInstance().getState();
if (status != TaskExecutionStatus.SUBMITTED_SUCCESS) {
if (status != TaskExecutionStatus.SUBMITTED_SUCCESS && status != TaskExecutionStatus.DELAY_EXECUTION) {
log.warn("The TaskInstance {} state is : {}, will not dispatch",
defaultTaskExecuteRunnable.getTaskInstance().getName(), status);
continue;
Expand Down
Expand Up @@ -48,9 +48,10 @@ public void operate(DefaultTaskExecuteRunnable taskExecuteRunnable) {
if (remainTime > 0) {
taskInstance.setState(TaskExecutionStatus.DELAY_EXECUTION);
taskInstanceDao.updateById(taskInstance);
log.info("Current taskInstance: {} is choose delay execution, delay time: {}/s, remainTime: {}/s",
log.info("Current taskInstance: {} is choose delay execution, delay time: {}/min, remainTime: {}/s",
taskInstance.getName(),
taskInstance.getDelayTime(), remainTime);
taskInstance.getDelayTime(),
remainTime);
}
globalTaskDispatchWaitingQueue.submitTaskExecuteRunnable(taskExecuteRunnable);
}
Expand Down

0 comments on commit 8354eea

Please sign in to comment.