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:
Iván Ovejero
2023-11-06 12:03:35 +01:00
committed by GitHub
parent 52f655f3d2
commit a994ba5e8d
5 changed files with 36 additions and 9 deletions

View File

@@ -118,7 +118,11 @@ export class License {
'@/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 sending of reloadLicense command...');
return;
}