refactor(core): Decouple event bus from internal hooks (no-changelog) (#9724)
This commit is contained in:
@@ -20,6 +20,8 @@ import { NodeCrashedError } from '@/errors/node-crashed.error';
|
||||
import { WorkflowCrashedError } from '@/errors/workflow-crashed.error';
|
||||
import { EventMessageNode } from '@/eventbus/EventMessageClasses/EventMessageNode';
|
||||
import { EventMessageWorkflow } from '@/eventbus/EventMessageClasses/EventMessageWorkflow';
|
||||
|
||||
import type { EventRelay } from '@/eventbus/event-relay.service';
|
||||
import type { EventMessageTypes as EventMessage } from '@/eventbus/EventMessageClasses';
|
||||
import type { Logger } from '@/Logger';
|
||||
|
||||
@@ -191,6 +193,7 @@ describe('ExecutionRecoveryService', () => {
|
||||
push,
|
||||
executionRepository,
|
||||
orchestrationService,
|
||||
mock<EventRelay>(),
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@ import config from '@/config';
|
||||
import { OnShutdown } from '@/decorators/OnShutdown';
|
||||
import type { QueueRecoverySettings } from './execution.types';
|
||||
import { OrchestrationService } from '@/services/orchestration.service';
|
||||
import { EventRelay } from '@/eventbus/event-relay.service';
|
||||
|
||||
/**
|
||||
* Service for recovering key properties in executions.
|
||||
@@ -27,6 +28,7 @@ export class ExecutionRecoveryService {
|
||||
private readonly push: Push,
|
||||
private readonly executionRepository: ExecutionRepository,
|
||||
private readonly orchestrationService: OrchestrationService,
|
||||
private readonly eventRelay: EventRelay,
|
||||
) {}
|
||||
|
||||
/**
|
||||
@@ -284,6 +286,14 @@ export class ExecutionRecoveryService {
|
||||
status: execution.status,
|
||||
});
|
||||
|
||||
this.eventRelay.emit('workflow-post-execute', {
|
||||
workflowId: execution.workflowData.id,
|
||||
workflowName: execution.workflowData.name,
|
||||
executionId: execution.id,
|
||||
success: execution.status === 'success',
|
||||
isManual: execution.mode === 'manual',
|
||||
});
|
||||
|
||||
const externalHooks = getWorkflowHooksMain(
|
||||
{
|
||||
userId: '',
|
||||
|
||||
Reference in New Issue
Block a user