Fix issue with queue mode

This commit is contained in:
Jan Oberhauser 2021-10-21 18:25:31 -05:00
parent a0b89ee5a4
commit 6fa8dd701e
4 changed files with 11 additions and 3 deletions

View file

@ -312,6 +312,9 @@ export class Start extends Command {
); );
} }
const instanceId = await UserSettings.getInstanceId();
InternalHooksManager.init(instanceId);
await Server.start(); await Server.start();
// Start to get active workflows and run their triggers // Start to get active workflows and run their triggers

View file

@ -18,6 +18,7 @@ import {
Db, Db,
ExternalHooks, ExternalHooks,
GenericHelpers, GenericHelpers,
InternalHooksManager,
LoadNodesAndCredentials, LoadNodesAndCredentials,
NodeTypes, NodeTypes,
WebhookServer, WebhookServer,
@ -147,6 +148,9 @@ export class Webhook extends Command {
// Wait till the database is ready // Wait till the database is ready
await startDbInitPromise; await startDbInitPromise;
const instanceId = await UserSettings.getInstanceId();
InternalHooksManager.init(instanceId);
if (config.get('executions.mode') === 'queue') { if (config.get('executions.mode') === 'queue') {
const redisHost = config.get('queue.bull.redis.host'); const redisHost = config.get('queue.bull.redis.host');
const redisPassword = config.get('queue.bull.redis.password'); const redisPassword = config.get('queue.bull.redis.password');

View file

@ -26,7 +26,7 @@ import {
IBullJobData, IBullJobData,
IBullJobResponse, IBullJobResponse,
IExecutionFlattedDb, IExecutionFlattedDb,
IExecutionResponse, InternalHooksManager,
LoadNodesAndCredentials, LoadNodesAndCredentials,
NodeTypes, NodeTypes,
ResponseHelper, ResponseHelper,
@ -259,6 +259,9 @@ export class Worker extends Command {
// eslint-disable-next-line @typescript-eslint/no-floating-promises // eslint-disable-next-line @typescript-eslint/no-floating-promises
Worker.jobQueue.process(flags.concurrency, async (job) => this.runJob(job, nodeTypes)); Worker.jobQueue.process(flags.concurrency, async (job) => this.runJob(job, nodeTypes));
const instanceId = await UserSettings.getInstanceId();
InternalHooksManager.init(instanceId);
const versions = await GenericHelpers.getVersions(); const versions = await GenericHelpers.getVersions();
console.info('\nn8n worker is now ready'); console.info('\nn8n worker is now ready');

View file

@ -312,8 +312,6 @@ class App {
this.frontendSettings.personalizationSurvey = this.frontendSettings.personalizationSurvey =
await PersonalizationSurvey.preparePersonalizationSurvey(); await PersonalizationSurvey.preparePersonalizationSurvey();
InternalHooksManager.init(this.frontendSettings.instanceId);
await this.externalHooks.run('frontend.settings', [this.frontendSettings]); await this.externalHooks.run('frontend.settings', [this.frontendSettings]);
const excludeEndpoints = config.get('security.excludeEndpoints') as string; const excludeEndpoints = config.get('security.excludeEndpoints') as string;