Skip to content

Commit

Permalink
[improve-apache#13045] format
Browse files Browse the repository at this point in the history
  • Loading branch information
fuchanghai committed Nov 30, 2022
1 parent 0c139b5 commit e9a6cda
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import org.apache.dolphinscheduler.common.enums.StateEventType;
import org.apache.dolphinscheduler.common.enums.WorkflowExecutionStatus;
import org.apache.dolphinscheduler.dao.entity.ProcessInstance;
import org.apache.dolphinscheduler.dao.repository.ProcessInstanceDao;
import org.apache.dolphinscheduler.server.master.cache.ProcessInstanceExecCacheManager;
import org.apache.dolphinscheduler.server.master.metrics.ProcessInstanceMetrics;
import org.apache.dolphinscheduler.server.master.runner.StateWheelExecuteThread;
Expand Down Expand Up @@ -75,9 +74,9 @@ public void handleWorkflowEvent(final WorkflowEvent workflowEvent) throws Workfl
logger.error("Failed to submit the workflow instance, will resend the workflow start event: {}",
workflowEvent);
workflowEvent.setMaxSubmitTimes(workflowEvent.getMaxSubmitTimes() - 1);
if(workflowEvent.getMaxSubmitTimes() >= 0){
if (workflowEvent.getMaxSubmitTimes() >= 0) {
workflowEventQueue.addEvent(workflowEvent);
}else {
} else {
WorkflowStateEvent stateEvent = WorkflowStateEvent.builder()
.processInstanceId(processInstance.getId())
.type(StateEventType.PROCESS_SUBMIT_FAILED)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public boolean handleStateEvent(WorkflowExecuteRunnable workflowExecuteRunnable,
return true;
}
if (workflowStateEvent.getStatus().isFinished()) {
if(workflowStateEvent.getType() == StateEventType.PROCESS_SUBMIT_FAILED){
if (workflowStateEvent.getType().equals(StateEventType.PROCESS_SUBMIT_FAILED)) {
workflowExecuteRunnable.updateProcessInstanceState(workflowStateEvent);
}
workflowExecuteRunnable.endProcess();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ public void run() {
taskDefinitionLogDao);
processInstanceExecCacheManager.cache(processInstance.getId(), workflowRunnable);
workflowEventQueue.addEvent(new WorkflowEvent(WorkflowEventType.START_WORKFLOW,
processInstance.getId(),masterConfig.getWorkflowMaxSubmitTimes()));
processInstance.getId(), masterConfig.getWorkflowMaxSubmitTimes()));
} finally {
LoggerUtils.removeWorkflowInstanceIdMDC();
}
Expand Down

0 comments on commit e9a6cda

Please sign in to comment.