Skip to content

Commit a478f56

Browse files
committed
Fix startup lock
1 parent 170b2d3 commit a478f56

2 files changed

Lines changed: 9 additions & 6 deletions

File tree

apps/meteor/ee/server/apps/orchestrator.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,10 @@ export class AppServerOrchestrator {
122122
}
123123

124124
getProvidedComponents() {
125+
if (!this.isLoaded()) {
126+
return;
127+
}
128+
125129
return this._manager.getExternalComponentManager().getProvidedComponents();
126130
}
127131

@@ -134,7 +138,7 @@ export class AppServerOrchestrator {
134138
}
135139

136140
isLoaded() {
137-
return this.getManager().areAppsLoaded();
141+
return this.isInitialized() && this.getManager().areAppsLoaded();
138142
}
139143

140144
isDebugging() {
@@ -161,7 +165,7 @@ export class AppServerOrchestrator {
161165
async load() {
162166
// Don't try to load it again if it has
163167
// already been loaded
164-
if (this.isLoaded()) {
168+
if (!this.isInitialized() || this.isLoaded()) {
165169
return;
166170
}
167171

apps/meteor/ee/server/apps/services/orchestratorFactory.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import type { Db } from 'mongodb';
22

33
import { settings } from '../../../../app/settings/server';
4-
import { AppServerOrchestrator } from '../orchestrator';
4+
import type { AppServerOrchestrator } from '../orchestrator';
5+
import { Apps } from '../orchestrator';
56

67
type AppsInitParams = {
78
appsSourceStorageFilesystemPath: any;
@@ -10,7 +11,7 @@ type AppsInitParams = {
1011
};
1112

1213
export class OrchestratorFactory {
13-
private static orchestrator: AppServerOrchestrator;
14+
private static orchestrator: AppServerOrchestrator = Apps;
1415

1516
private static createOrchestrator(_db: Db) {
1617
const appsInitParams: AppsInitParams = {
@@ -19,7 +20,6 @@ export class OrchestratorFactory {
1920
marketplaceUrl: 'https://marketplace.rocket.chat',
2021
};
2122

22-
this.orchestrator = new AppServerOrchestrator();
2323
// this.orchestrator = new AppServerOrchestrator(db);
2424

2525
const { OVERWRITE_INTERNAL_MARKETPLACE_URL } = process.env || {};
@@ -28,7 +28,6 @@ export class OrchestratorFactory {
2828
appsInitParams.marketplaceUrl = OVERWRITE_INTERNAL_MARKETPLACE_URL;
2929
}
3030

31-
this.orchestrator.initialize();
3231
// this.orchestrator.initialize(appsInitParams);
3332
}
3433

0 commit comments

Comments
 (0)