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

@@ -7,6 +7,8 @@ import { Queue } from '@/Queue';
import { BaseCommand } from './BaseCommand';
import { Container } from 'typedi';
import { IConfig } from '@oclif/config';
import { OrchestrationWebhookService } from '@/services/orchestration/webhook/orchestration.webhook.service';
import { OrchestrationHandlerWebhookService } from '@/services/orchestration/webhook/orchestration.handler.webhook.service';
export class Webhook extends BaseCommand {
static description = 'Starts n8n webhook process. Intercepts only production URLs.';
@@ -94,6 +96,8 @@ export class Webhook 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();
@@ -115,4 +119,9 @@ export class Webhook extends BaseCommand {
async catch(error: Error) {
await this.exitWithCrash('Exiting due to an error.', error);
}
async initOrchestration() {
await Container.get(OrchestrationWebhookService).init();
await Container.get(OrchestrationHandlerWebhookService).init();
}
}