From b092bef8139f9db692872073ce9788c19b364780 Mon Sep 17 00:00:00 2001 From: Douglas Gubert Date: Mon, 1 Nov 2021 16:09:08 -0300 Subject: [PATCH] Start scheduler after apps have been loaded (#23566) --- app/apps/server/bridges/scheduler.ts | 2 +- app/apps/server/orchestrator.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/apps/server/bridges/scheduler.ts b/app/apps/server/bridges/scheduler.ts index 698931a25be2..721c3a8c8aa0 100644 --- a/app/apps/server/bridges/scheduler.ts +++ b/app/apps/server/bridges/scheduler.ts @@ -198,7 +198,7 @@ export class AppSchedulerBridge extends SchedulerBridge { } } - private async startScheduler(): Promise { + public async startScheduler(): Promise { if (!this.isConnected) { await this.scheduler.start(); this.isConnected = true; diff --git a/app/apps/server/orchestrator.js b/app/apps/server/orchestrator.js index a68d24197f56..81eaad8110d8 100644 --- a/app/apps/server/orchestrator.js +++ b/app/apps/server/orchestrator.js @@ -158,7 +158,8 @@ export class AppServerOrchestrator { return this._manager.load() .then((affs) => console.log(`Loaded the Apps Framework and loaded a total of ${ affs.length } Apps!`)) - .catch((err) => console.warn('Failed to load the Apps Framework and Apps!', err)); + .catch((err) => console.warn('Failed to load the Apps Framework and Apps!', err)) + .then(() => this.getBridges().getSchedulerBridge().startScheduler()); } async unload() {