fix(core): Fix crashes in queue mode (#3397)

* Add catch block to avoid crashes when running in queue mode

* Throwing errors that happen in worker so process stops
This commit is contained in:
Omar Ajoue 2022-06-02 12:17:24 +02:00 committed by GitHub
parent 50ff75ecb2
commit 042b8daf1c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 0 deletions

View file

@ -354,6 +354,7 @@ export class Worker extends Command {
process.exit(2);
} else {
logger.error('Error from queue: ', error);
throw error;
}
});

View file

@ -561,6 +561,12 @@ export class WorkflowRunner {
},
);
workflowExecution.catch(() => {
// We `reject` this promise if the execution fails
// but the error is handled already by processError
// So we're just preventing crashes here.
});
this.activeExecutions.attachWorkflowExecution(executionId, workflowExecution);
return executionId;
}