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,6 +31,8 @@ import { InternalHooks } from '@/InternalHooks';
import { License } from '@/License';
import { ExecutionRepository } from '@/databases/repositories/execution.repository';
import { IConfig } from '@oclif/config';
import { OrchestrationMainService } from '@/services/orchestration/main/orchestration.main.service';
import { OrchestrationHandlerMainService } from '@/services/orchestration/main/orchestration.handler.main.service';
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-var-requires
const open = require('open');
@@ -214,6 +216,8 @@ export class Start extends BaseCommand {
await this.initLicense();
this.logger.debug('License init complete');
await this.initOrchestration();
this.logger.debug('Orchestration init complete');
await this.initBinaryDataService();
this.logger.debug('Binary data service init complete');
await this.initExternalHooks();
@@ -228,6 +232,13 @@ export class Start extends BaseCommand {
}
}
async initOrchestration() {
if (config.get('executions.mode') === 'queue') {
await Container.get(OrchestrationMainService).init();
await Container.get(OrchestrationHandlerMainService).init();
}
}
async run() {
// eslint-disable-next-line @typescript-eslint/no-shadow
const { flags } = this.parse(Start);