mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-20 03:12:15 +00:00
⚡ Add await statement to hooks (#1775)
This commit is contained in:
@@ -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]);
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user