mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-24 04:04:06 -08:00
⚡ Add await statement to hooks (#1775)
This commit is contained in:
parent
caa55a022b
commit
6ffc544888
|
@ -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]);
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue