fix(core): Move nodeExecute InternalHook calls to hookFunctionsSave (#6193)

nodeExecute InternalHooks to hookFunctionsSave
This commit is contained in:
Michael Auerswald 2023-05-05 17:49:43 +02:00 committed by GitHub
parent be089331b3
commit f00b2ae3ea
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -515,8 +515,24 @@ export function hookFunctionsPreExecute(parentProcessMode?: string): IWorkflowEx
*/
function hookFunctionsSave(parentProcessMode?: string): IWorkflowExecuteHooks {
return {
nodeExecuteBefore: [],
nodeExecuteAfter: [],
nodeExecuteBefore: [
async function (this: WorkflowHooks, nodeName: string): Promise<void> {
void Container.get(InternalHooks).onNodeBeforeExecute(
this.executionId,
this.workflowData,
nodeName,
);
},
],
nodeExecuteAfter: [
async function (this: WorkflowHooks, nodeName: string): Promise<void> {
void Container.get(InternalHooks).onNodePostExecute(
this.executionId,
this.workflowData,
nodeName,
);
},
],
workflowExecuteBefore: [],
workflowExecuteAfter: [
async function (
@ -1261,26 +1277,6 @@ export function getWorkflowHooksWorkerMain(
hookFunctions.nodeExecuteBefore = [];
hookFunctions.nodeExecuteAfter = [];
hookFunctions.nodeExecuteBefore.push(async function (
this: WorkflowHooks,
nodeName: string,
): Promise<void> {
void Container.get(InternalHooks).onNodeBeforeExecute(
this.executionId,
this.workflowData,
nodeName,
);
});
hookFunctions.nodeExecuteAfter.push(async function (
this: WorkflowHooks,
nodeName: string,
): Promise<void> {
void Container.get(InternalHooks).onNodePostExecute(
this.executionId,
this.workflowData,
nodeName,
);
});
return new WorkflowHooks(hookFunctions, mode, executionId, workflowData, optionalParameters);
}
@ -1313,27 +1309,7 @@ export function getWorkflowHooksMain(
}
if (!hookFunctions.nodeExecuteBefore) hookFunctions.nodeExecuteBefore = [];
hookFunctions.nodeExecuteBefore?.push(async function (
this: WorkflowHooks,
nodeName: string,
): Promise<void> {
void Container.get(InternalHooks).onNodeBeforeExecute(
this.executionId,
this.workflowData,
nodeName,
);
});
if (!hookFunctions.nodeExecuteAfter) hookFunctions.nodeExecuteAfter = [];
hookFunctions.nodeExecuteAfter.push(async function (
this: WorkflowHooks,
nodeName: string,
): Promise<void> {
void Container.get(InternalHooks).onNodePostExecute(
this.executionId,
this.workflowData,
nodeName,
);
});
return new WorkflowHooks(hookFunctions, data.executionMode, executionId, data.workflowData, {
sessionId: data.sessionId,