refactor(core): Move multi-main state to InstanceSettings (#12144)

This commit is contained in:
Iván Ovejero
2024-12-11 18:25:22 +01:00
committed by GitHub
parent 77e2c75ca6
commit 28f1f6b561
18 changed files with 96 additions and 103 deletions

View File

@@ -1,5 +1,6 @@
import type express from 'express';
import * as NodeExecuteFunctions from 'n8n-core';
import { InstanceSettings } from 'n8n-core';
import { WebhookPathTakenError, Workflow } from 'n8n-workflow';
import type {
IWebhookData,
@@ -17,7 +18,6 @@ import type { IWorkflowDb } from '@/interfaces';
import { NodeTypes } from '@/node-types';
import { Push } from '@/push';
import { Publisher } from '@/scaling/pubsub/publisher.service';
import { OrchestrationService } from '@/services/orchestration.service';
import { removeTrailingSlash } from '@/utils';
import type { TestWebhookRegistration } from '@/webhooks/test-webhook-registrations.service';
import { TestWebhookRegistrationsService } from '@/webhooks/test-webhook-registrations.service';
@@ -42,7 +42,7 @@ export class TestWebhooks implements IWebhookManager {
private readonly push: Push,
private readonly nodeTypes: NodeTypes,
private readonly registrations: TestWebhookRegistrationsService,
private readonly orchestrationService: OrchestrationService,
private readonly instanceSettings: InstanceSettings,
private readonly publisher: Publisher,
) {}
@@ -155,7 +155,7 @@ export class TestWebhooks implements IWebhookManager {
* the handler process commands the creator process to clear its test webhooks.
*/
if (
this.orchestrationService.isMultiMainSetupEnabled &&
this.instanceSettings.isMultiMain &&
pushRef &&
!this.push.getBackend().hasPushRef(pushRef)
) {