🐛 Fixed an issue with queue mode for executions that should not be saved (#1509)

* Fixed an issue with queue mode for executions that should not be saved

*  Minimal change

Co-authored-by: Jan Oberhauser <jan.oberhauser@gmail.com>
This commit is contained in:
Omar Ajoue
2021-03-10 15:51:18 +01:00
committed by GitHub
parent 3d80129a28
commit d6d57c2df6
5 changed files with 140 additions and 2 deletions

View File

@@ -41,8 +41,18 @@ export class WorkflowRunnerProcess {
workflowExecute: WorkflowExecute | undefined;
executionIdCallback: (executionId: string) => void | undefined;
static async stopProcess() {
setTimeout(() => {
// Attempt a graceful shutdown, giving executions 30 seconds to finish
process.exit(0);
}, 30000);
}
async runWorkflow(inputData: IWorkflowExecutionDataProcessWithExecution): Promise<IRun> {
process.on('SIGTERM', WorkflowRunnerProcess.stopProcess);
process.on('SIGINT', WorkflowRunnerProcess.stopProcess);
this.data = inputData;
let className: string;
let tempNode: INodeType;