Add await statement to hooks (#1775)

This commit is contained in:
Omar Ajoue 2021-05-12 05:15:22 +02:00 committed by GitHub
parent caa55a022b
commit 6ffc544888
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -194,9 +194,9 @@ export class WorkflowRunnerProcess {
* @param {any[]} parameters * @param {any[]} parameters
* @memberof WorkflowRunnerProcess * @memberof WorkflowRunnerProcess
*/ */
sendHookToParentProcess(hook: string, parameters: any[]) { // tslint:disable-line:no-any async sendHookToParentProcess(hook: string, parameters: any[]) { // tslint:disable-line:no-any
try { try {
sendToParentProcess('processHook', { await sendToParentProcess('processHook', {
hook, hook,
parameters, parameters,
}); });
@ -217,22 +217,22 @@ export class WorkflowRunnerProcess {
const hookFunctions: IWorkflowExecuteHooks = { const hookFunctions: IWorkflowExecuteHooks = {
nodeExecuteBefore: [ nodeExecuteBefore: [
async (nodeName: string): Promise<void> => { async (nodeName: string): Promise<void> => {
this.sendHookToParentProcess('nodeExecuteBefore', [nodeName]); await this.sendHookToParentProcess('nodeExecuteBefore', [nodeName]);
}, },
], ],
nodeExecuteAfter: [ nodeExecuteAfter: [
async (nodeName: string, data: ITaskData): Promise<void> => { async (nodeName: string, data: ITaskData): Promise<void> => {
this.sendHookToParentProcess('nodeExecuteAfter', [nodeName, data]); await this.sendHookToParentProcess('nodeExecuteAfter', [nodeName, data]);
}, },
], ],
workflowExecuteBefore: [ workflowExecuteBefore: [
async (): Promise<void> => { async (): Promise<void> => {
this.sendHookToParentProcess('workflowExecuteBefore', []); await this.sendHookToParentProcess('workflowExecuteBefore', []);
}, },
], ],
workflowExecuteAfter: [ workflowExecuteAfter: [
async (fullRunData: IRun, newStaticData?: IDataObject): Promise<void> => { async (fullRunData: IRun, newStaticData?: IDataObject): Promise<void> => {
this.sendHookToParentProcess('workflowExecuteAfter', [fullRunData, newStaticData]); await this.sendHookToParentProcess('workflowExecuteAfter', [fullRunData, newStaticData]);
}, },
], ],
}; };