mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2026-07-18 02:47:20 +02:00
refactor(core): Remove event bus helpers (no-changelog) (#9690)
This commit is contained in:
@@ -22,14 +22,12 @@ import type { EventMessageAuditOptions } from '../EventMessageClasses/EventMessa
|
||||
import { EventMessageAudit } from '../EventMessageClasses/EventMessageAudit';
|
||||
import type { EventMessageWorkflowOptions } from '../EventMessageClasses/EventMessageWorkflow';
|
||||
import { EventMessageWorkflow } from '../EventMessageClasses/EventMessageWorkflow';
|
||||
import { isLogStreamingEnabled } from './MessageEventBusHelper';
|
||||
import type { EventMessageNodeOptions } from '../EventMessageClasses/EventMessageNode';
|
||||
import { EventMessageNode } from '../EventMessageClasses/EventMessageNode';
|
||||
import {
|
||||
EventMessageGeneric,
|
||||
eventMessageGenericDestinationTestEvent,
|
||||
} from '../EventMessageClasses/EventMessageGeneric';
|
||||
import { METRICS_EVENT_NAME } from '../MessageEventBusDestination/Helpers.ee';
|
||||
import type { AbstractEventMessageOptions } from '../EventMessageClasses/AbstractEventMessageOptions';
|
||||
import { getEventMessageObjectByType } from '../EventMessageClasses/Helpers';
|
||||
import { ExecutionRecoveryService } from '../../executions/execution-recovery.service';
|
||||
@@ -37,6 +35,7 @@ import {
|
||||
EventMessageAiNode,
|
||||
type EventMessageAiNodeOptions,
|
||||
} from '../EventMessageClasses/EventMessageAiNode';
|
||||
import { License } from '@/License';
|
||||
|
||||
export type EventMessageReturnMode = 'sent' | 'unsent' | 'all' | 'unfinished';
|
||||
|
||||
@@ -69,6 +68,7 @@ export class MessageEventBus extends EventEmitter {
|
||||
private readonly workflowRepository: WorkflowRepository,
|
||||
private readonly orchestrationService: OrchestrationService,
|
||||
private readonly recoveryService: ExecutionRecoveryService,
|
||||
private readonly license: License,
|
||||
) {
|
||||
super();
|
||||
}
|
||||
@@ -329,7 +329,7 @@ export class MessageEventBus extends EventEmitter {
|
||||
}
|
||||
|
||||
private async emitMessage(msg: EventMessageTypes) {
|
||||
this.emit(METRICS_EVENT_NAME, msg);
|
||||
this.emit('metrics.messageEventBus.Event', msg);
|
||||
|
||||
// generic emit for external modules to capture events
|
||||
// this is for internal use ONLY and not for use with custom destinations!
|
||||
@@ -350,7 +350,7 @@ export class MessageEventBus extends EventEmitter {
|
||||
|
||||
shouldSendMsg(msg: EventMessageTypes): boolean {
|
||||
return (
|
||||
isLogStreamingEnabled() &&
|
||||
this.license.isLogStreamingEnabled() &&
|
||||
Object.keys(this.destinations).length > 0 &&
|
||||
this.hasAnyDestinationSubscribedToEvent(msg)
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user