fix(core): Fix canceled execution status (#6142)
This commit is contained in:
committed by
GitHub
parent
06fa6f1fb3
commit
839a56a682
@@ -290,6 +290,10 @@ export class InternalHooks implements IInternalHooksClass {
|
||||
properties.user_id = userId;
|
||||
}
|
||||
|
||||
if (runData?.data.resultData.error?.message?.includes('canceled')) {
|
||||
runData.status = 'canceled';
|
||||
}
|
||||
|
||||
properties.success = !!runData?.finished;
|
||||
|
||||
let executionStatus: ExecutionStatus;
|
||||
@@ -297,6 +301,8 @@ export class InternalHooks implements IInternalHooksClass {
|
||||
executionStatus = 'crashed';
|
||||
} else if (runData?.status === 'waiting' || runData?.data?.waitTill) {
|
||||
executionStatus = 'waiting';
|
||||
} else if (runData?.status === 'canceled') {
|
||||
executionStatus = 'canceled';
|
||||
} else {
|
||||
executionStatus = properties.success ? 'success' : 'failed';
|
||||
}
|
||||
|
||||
@@ -583,9 +583,12 @@ function hookFunctionsSave(parentProcessMode?: string): IWorkflowExecuteHooks {
|
||||
}
|
||||
|
||||
const workflowHasCrashed = fullRunData.status === 'crashed';
|
||||
const workflowDidSucceed = !fullRunData.data.resultData.error && !workflowHasCrashed;
|
||||
const workflowWasCanceled = fullRunData.status === 'canceled';
|
||||
const workflowDidSucceed =
|
||||
!fullRunData.data.resultData.error && !workflowHasCrashed && !workflowWasCanceled;
|
||||
let workflowStatusFinal: ExecutionStatus = workflowDidSucceed ? 'success' : 'failed';
|
||||
if (workflowHasCrashed) workflowStatusFinal = 'crashed';
|
||||
if (workflowWasCanceled) workflowStatusFinal = 'canceled';
|
||||
|
||||
if (
|
||||
(workflowDidSucceed && saveDataSuccessExecution === 'none') ||
|
||||
@@ -755,9 +758,12 @@ function hookFunctionsSaveWorker(): IWorkflowExecuteHooks {
|
||||
}
|
||||
|
||||
const workflowHasCrashed = fullRunData.status === 'crashed';
|
||||
const workflowDidSucceed = !fullRunData.data.resultData.error && !workflowHasCrashed;
|
||||
const workflowWasCanceled = fullRunData.status === 'canceled';
|
||||
const workflowDidSucceed =
|
||||
!fullRunData.data.resultData.error && !workflowHasCrashed && !workflowWasCanceled;
|
||||
let workflowStatusFinal: ExecutionStatus = workflowDidSucceed ? 'success' : 'failed';
|
||||
if (workflowHasCrashed) workflowStatusFinal = 'crashed';
|
||||
if (workflowWasCanceled) workflowStatusFinal = 'canceled';
|
||||
|
||||
if (!workflowDidSucceed) {
|
||||
executeErrorWorkflow(
|
||||
|
||||
@@ -472,6 +472,8 @@ process.on('message', async (message: IProcessMessage) => {
|
||||
? new WorkflowOperationError('Workflow execution timed out!')
|
||||
: new WorkflowOperationError('Workflow-Execution has been canceled!');
|
||||
|
||||
runData.status = message.type === 'timeout' ? 'failed' : 'canceled';
|
||||
|
||||
// If there is any data send it to parent process, if execution timedout add the error
|
||||
await workflowRunner.workflowExecute.processSuccessExecution(
|
||||
workflowRunner.startedAt,
|
||||
|
||||
Reference in New Issue
Block a user