refactor(core): Lock webhook process out of multi-main setup (no-changelog) (#8549)

This commit is contained in:
Iván Ovejero
2024-02-05 18:06:54 +01:00
committed by GitHub
parent dca50dcc68
commit 28aee7c425
2 changed files with 79 additions and 4 deletions

View File

@@ -1,6 +1,6 @@
import { Container } from 'typedi';
import { Flags, type Config } from '@oclif/core';
import { sleep } from 'n8n-workflow';
import { ApplicationError, sleep } from 'n8n-workflow';
import config from '@/config';
import { ActiveExecutions } from '@/ActiveExecutions';
@@ -102,6 +102,12 @@ export class Webhook extends BaseCommand {
}
async run() {
if (config.getEnv('multiMainSetup.enabled')) {
throw new ApplicationError(
'Webhook process cannot be started when multi-main setup is enabled.',
);
}
await Container.get(Queue).init();
await this.server.start();
this.logger.debug(`Webhook listener ID: ${this.server.uniqueInstanceId}`);