refactor(core): Use type-safe event emitters (no-changelog) (#10234)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2024-07-30 13:23:01 +02:00
committed by GitHub
parent 99dc56c7a1
commit 1fca3af335
12 changed files with 124 additions and 89 deletions

View File

@@ -525,17 +525,16 @@ function hookFunctionsSave(): IWorkflowExecuteHooks {
);
}
} finally {
workflowStatisticsService.emit(
'workflowExecutionCompleted',
this.workflowData,
workflowStatisticsService.emit('workflowExecutionCompleted', {
workflowData: this.workflowData,
fullRunData,
);
});
}
},
],
nodeFetchedData: [
async (workflowId: string, node: INode) => {
workflowStatisticsService.emit('nodeFetchedData', workflowId, node);
workflowStatisticsService.emit('nodeFetchedData', { workflowId, node });
},
],
};
@@ -636,11 +635,10 @@ function hookFunctionsSaveWorker(): IWorkflowExecuteHooks {
this.retryOf,
);
} finally {
workflowStatisticsService.emit(
'workflowExecutionCompleted',
this.workflowData,
workflowStatisticsService.emit('workflowExecutionCompleted', {
workflowData: this.workflowData,
fullRunData,
);
});
}
},
async function (this: WorkflowHooks, runData: IRun): Promise<void> {
@@ -676,7 +674,7 @@ function hookFunctionsSaveWorker(): IWorkflowExecuteHooks {
],
nodeFetchedData: [
async (workflowId: string, node: INode) => {
workflowStatisticsService.emit('nodeFetchedData', workflowId, node);
workflowStatisticsService.emit('nodeFetchedData', { workflowId, node });
},
],
};