refactor(core): Have one orchestration service per instance type (#7303)

webhook instances will not listen to either worker or event log messages
on the Redis pub/sub channel
This commit is contained in:
Michael Auerswald
2023-10-06 13:58:11 +02:00
committed by GitHub
parent 193181a9c6
commit afa683a06f
25 changed files with 380 additions and 215 deletions

View File

@@ -31,7 +31,7 @@ import Container, { Service } from 'typedi';
import { ExecutionRepository, WorkflowRepository } from '@/databases/repositories';
import type { AbstractEventMessageOptions } from '../EventMessageClasses/AbstractEventMessageOptions';
import { getEventMessageObjectByType } from '../EventMessageClasses/Helpers';
import { OrchestrationService } from '../../services/orchestration.service';
import { OrchestrationMainService } from '@/services/orchestration/main/orchestration.main.service';
export type EventMessageReturnMode = 'sent' | 'unsent' | 'all' | 'unfinished';
@@ -190,7 +190,9 @@ export class MessageEventBus extends EventEmitter {
this.destinations[destination.getId()] = destination;
this.destinations[destination.getId()].startListening();
if (notifyWorkers) {
await Container.get(OrchestrationService).broadcastRestartEventbusAfterDestinationUpdate();
await Container.get(
OrchestrationMainService,
).broadcastRestartEventbusAfterDestinationUpdate();
}
return destination;
}
@@ -216,7 +218,9 @@ export class MessageEventBus extends EventEmitter {
delete this.destinations[id];
}
if (notifyWorkers) {
await Container.get(OrchestrationService).broadcastRestartEventbusAfterDestinationUpdate();
await Container.get(
OrchestrationMainService,
).broadcastRestartEventbusAfterDestinationUpdate();
}
return result;
}