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

@@ -511,7 +511,7 @@ export class ActiveWorkflowManager {
existingWorkflow?: WorkflowEntity,
{ shouldPublish } = { shouldPublish: true },
) {
if (this.orchestrationService.isMultiMainSetupEnabled && shouldPublish) {
if (this.instanceSettings.isMultiMain && shouldPublish) {
void this.publisher.publishCommand({
command: 'add-webhooks-triggers-and-pollers',
payload: { workflowId },
@@ -703,7 +703,7 @@ export class ActiveWorkflowManager {
// TODO: this should happen in a transaction
// maybe, see: https://github.com/n8n-io/n8n/pull/8904#discussion_r1530150510
async remove(workflowId: string) {
if (this.orchestrationService.isMultiMainSetupEnabled) {
if (this.instanceSettings.isMultiMain) {
try {
await this.clearWebhooks(workflowId);
} catch (error) {