refactor(core): Decouple leadership-change handlers using decorators (#15009)

This commit is contained in:
Iván Ovejero
2025-04-30 12:59:57 +02:00
committed by GitHub
parent 9541b5bb07
commit 9c0e0f0d2e
16 changed files with 49 additions and 127 deletions

View File

@@ -261,18 +261,6 @@ export class Start extends BaseCommand {
await subscriber.subscribe('n8n.worker-response');
this.logger.scoped(['scaling', 'pubsub']).debug('Pubsub setup completed');
if (this.instanceSettings.isSingleMain) return;
orchestrationService.multiMainSetup
.on('leader-stepdown', async () => {
this.license.disableAutoRenewals();
await this.activeWorkflowManager.removeAllTriggerAndPollerBasedWorkflows();
})
.on('leader-takeover', async () => {
this.license.enableAutoRenewals();
await this.activeWorkflowManager.addAllTriggerAndPollerBasedWorkflows();
});
}
async run() {