From 6ffc544888524a9c76eacf93c5e3326da54c75af Mon Sep 17 00:00:00 2001 From: Omar Ajoue Date: Wed, 12 May 2021 05:15:22 +0200 Subject: [PATCH] :zap: Add await statement to hooks (#1775) --- packages/cli/src/WorkflowRunnerProcess.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/cli/src/WorkflowRunnerProcess.ts b/packages/cli/src/WorkflowRunnerProcess.ts index 14ae4a1abf..4a09c76a89 100644 --- a/packages/cli/src/WorkflowRunnerProcess.ts +++ b/packages/cli/src/WorkflowRunnerProcess.ts @@ -194,9 +194,9 @@ export class WorkflowRunnerProcess { * @param {any[]} parameters * @memberof WorkflowRunnerProcess */ - sendHookToParentProcess(hook: string, parameters: any[]) { // tslint:disable-line:no-any + async sendHookToParentProcess(hook: string, parameters: any[]) { // tslint:disable-line:no-any try { - sendToParentProcess('processHook', { + await sendToParentProcess('processHook', { hook, parameters, }); @@ -217,22 +217,22 @@ export class WorkflowRunnerProcess { const hookFunctions: IWorkflowExecuteHooks = { nodeExecuteBefore: [ async (nodeName: string): Promise => { - this.sendHookToParentProcess('nodeExecuteBefore', [nodeName]); + await this.sendHookToParentProcess('nodeExecuteBefore', [nodeName]); }, ], nodeExecuteAfter: [ async (nodeName: string, data: ITaskData): Promise => { - this.sendHookToParentProcess('nodeExecuteAfter', [nodeName, data]); + await this.sendHookToParentProcess('nodeExecuteAfter', [nodeName, data]); }, ], workflowExecuteBefore: [ async (): Promise => { - this.sendHookToParentProcess('workflowExecuteBefore', []); + await this.sendHookToParentProcess('workflowExecuteBefore', []); }, ], workflowExecuteAfter: [ async (fullRunData: IRun, newStaticData?: IDataObject): Promise => { - this.sendHookToParentProcess('workflowExecuteAfter', [fullRunData, newStaticData]); + await this.sendHookToParentProcess('workflowExecuteAfter', [fullRunData, newStaticData]); }, ], };