mirror of
https://github.com/PowerJob/PowerJob.git
synced 2025-07-17 00:00:04 +08:00
fix: task status rollback #190
This commit is contained in:
parent
cdaea08ba7
commit
cce26511d8
@ -155,4 +155,10 @@ public class CommonUtils {
|
|||||||
return StringUtils.replace(UUID.randomUUID().toString(), "-", "");
|
return StringUtils.replace(UUID.randomUUID().toString(), "-", "");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void easySleep(long millis) {
|
||||||
|
try {
|
||||||
|
Thread.sleep(millis);
|
||||||
|
} catch (InterruptedException ignore) {
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,7 @@ package com.github.kfcfans.powerjob.worker.core.executor;
|
|||||||
|
|
||||||
import akka.actor.ActorSelection;
|
import akka.actor.ActorSelection;
|
||||||
import com.github.kfcfans.powerjob.common.ExecuteType;
|
import com.github.kfcfans.powerjob.common.ExecuteType;
|
||||||
|
import com.github.kfcfans.powerjob.common.utils.CommonUtils;
|
||||||
import com.github.kfcfans.powerjob.worker.OhMyWorker;
|
import com.github.kfcfans.powerjob.worker.OhMyWorker;
|
||||||
import com.github.kfcfans.powerjob.worker.common.ThreadLocalStore;
|
import com.github.kfcfans.powerjob.worker.common.ThreadLocalStore;
|
||||||
import com.github.kfcfans.powerjob.worker.common.constants.TaskConstant;
|
import com.github.kfcfans.powerjob.worker.common.constants.TaskConstant;
|
||||||
@ -161,6 +162,9 @@ public class ProcessorRunnable implements Runnable {
|
|||||||
* @param cmd 特殊需求,比如广播执行需要创建广播任务
|
* @param cmd 特殊需求,比如广播执行需要创建广播任务
|
||||||
*/
|
*/
|
||||||
private void reportStatus(TaskStatus status, String result, Integer cmd) {
|
private void reportStatus(TaskStatus status, String result, Integer cmd) {
|
||||||
|
|
||||||
|
CommonUtils.easySleep(1);
|
||||||
|
|
||||||
ProcessorReportTaskStatusReq req = new ProcessorReportTaskStatusReq();
|
ProcessorReportTaskStatusReq req = new ProcessorReportTaskStatusReq();
|
||||||
|
|
||||||
req.setInstanceId(task.getInstanceId());
|
req.setInstanceId(task.getInstanceId());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user