mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
refactor(core): Decouple leadership-change handlers using decorators (#15009)
This commit is contained in:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user