mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 02:21:13 +00:00
fix(core): Ensure init before checking leader or follower in multi-main scenario (#7621)
This PR ensures `MultiMainInstancePublisher` is initialized before checking if the instance is leader or follower. Followers skip license init, license check, and pruning start and stop.
This commit is contained in:
@@ -248,7 +248,11 @@ export abstract class BaseCommand extends Command {
|
||||
'@/services/orchestration/main/MultiMainInstance.publisher.ee'
|
||||
);
|
||||
|
||||
if (Container.get(MultiMainInstancePublisher).isFollower) {
|
||||
const multiMainInstancePublisher = Container.get(MultiMainInstancePublisher);
|
||||
|
||||
await multiMainInstancePublisher.init();
|
||||
|
||||
if (multiMainInstancePublisher.isFollower) {
|
||||
this.logger.debug('Instance is follower, skipping license initialization...');
|
||||
return;
|
||||
}
|
||||
@@ -269,6 +273,7 @@ export abstract class BaseCommand extends Command {
|
||||
try {
|
||||
this.logger.debug('Attempting license activation');
|
||||
await license.activate(activationKey);
|
||||
this.logger.debug('License init complete');
|
||||
} catch (e) {
|
||||
this.logger.error('Could not activate license', e as Error);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user