mirror of
https://github.com/PowerJob/PowerJob.git
synced 2025-07-17 00:00:04 +08:00
fix: missing workflow instance result and finished time
This commit is contained in:
parent
6d5225beab
commit
79b30f882d
@ -46,6 +46,10 @@ public class SystemInstanceResult {
|
||||
public static final String MIDDLE_JOB_STOPPED = "middle job stopped by user";
|
||||
public static final String CAN_NOT_FIND_JOB = "can't find some job";
|
||||
|
||||
/**
|
||||
* 没有启用的节点
|
||||
*/
|
||||
public static final String NO_ENABLED_NODES = "no enabled nodes";
|
||||
/**
|
||||
* 被用户手动停止
|
||||
*/
|
||||
|
@ -20,7 +20,8 @@ import com.github.kfcfans.powerjob.server.service.alarm.WorkflowInstanceAlarm;
|
||||
import com.github.kfcfans.powerjob.server.service.id.IdGenerateService;
|
||||
import com.github.kfcfans.powerjob.server.service.instance.InstanceService;
|
||||
import com.github.kfcfans.powerjob.server.service.lock.local.UseSegmentLock;
|
||||
import com.google.common.collect.*;
|
||||
import com.google.common.collect.Maps;
|
||||
import com.google.common.collect.Sets;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
@ -191,6 +192,8 @@ public class WorkflowInstanceManager {
|
||||
if (readyNodes.isEmpty()) {
|
||||
// 没有就绪的节点(所有节点都被禁用)
|
||||
wfInstanceInfo.setStatus(WorkflowInstanceStatus.SUCCEED.getV());
|
||||
wfInstanceInfo.setResult(SystemInstanceResult.NO_ENABLED_NODES);
|
||||
wfInstanceInfo.setFinishedTime(System.currentTimeMillis());
|
||||
log.warn("[Workflow-{}|{}] workflowInstance({}) needn't running ", wfInfo.getId(), wfInstanceId, wfInstanceInfo);
|
||||
workflowInstanceInfoRepository.saveAndFlush(wfInstanceInfo);
|
||||
return;
|
||||
|
Loading…
x
Reference in New Issue
Block a user