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

@@ -100,7 +100,7 @@ export class Start extends BaseCommand {
await this.activeWorkflowManager.removeAllTriggerAndPollerBasedWorkflows();
if (Container.get(OrchestrationService).isMultiMainSetupEnabled) {
if (this.instanceSettings.isMultiMain) {
await Container.get(OrchestrationService).shutdown();
}
@@ -192,6 +192,9 @@ export class Start extends BaseCommand {
await super.init();
this.activeWorkflowManager = Container.get(ActiveWorkflowManager);
this.instanceSettings.setMultiMainEnabled(
config.getEnv('executions.mode') === 'queue' && this.globalConfig.multiMainSetup.enabled,
);
await this.initLicense();
await this.initOrchestration();
@@ -253,7 +256,7 @@ export class Start extends BaseCommand {
this.logger.scoped(['scaling', 'pubsub']).debug('Pubsub setup completed');
if (!orchestrationService.isMultiMainSetupEnabled) return;
if (this.instanceSettings.isSingleMain) return;
orchestrationService.multiMainSetup
.on('leader-stepdown', async () => {