Skip to content

Commit 598547a

Browse files
committed
Add feature toggle to be able to disable ecosystem pre-loading before start
1 parent 8113aea commit 598547a

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

api/index.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ validateEnvironmentVariables();
66

77
import { disconnect, prepareDatabaseConnection } from './db/knex-database-connection.js';
88
import { createServer } from './server.js';
9+
import { config } from './src/shared/config.js';
910
import { learningContentCache } from './src/shared/infrastructure/caches/learning-content-cache.js';
1011
import { initLearningContent } from './src/shared/infrastructure/datasources/learning-content/datasource.js';
1112
import { temporaryStorage } from './src/shared/infrastructure/temporary-storage/index.js';
@@ -30,7 +31,9 @@ async function _setupEcosystem() {
3031
}
3132

3233
const start = async function () {
33-
await _setupEcosystem();
34+
if (config.featureToggles.setupEcosystemBeforeStart) {
35+
await _setupEcosystem();
36+
}
3437
server = await createServer();
3538
await server.start();
3639
};

api/src/shared/config.js

+1
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,7 @@ const configuration = (function () {
214214
isQuestEnabled: toBoolean(process.env.FT_ENABLE_QUESTS),
215215
isTextToSpeechButtonEnabled: toBoolean(process.env.FT_ENABLE_TEXT_TO_SPEECH_BUTTON),
216216
isV3EligibilityCheckEnabled: toBoolean(process.env.FT_ENABLE_V3_ELIGIBILITY_CHECK),
217+
setupEcosystemBeforeStart: toBoolean(process.env.FT_SETUP_ECOSYSTEM_BEFORE_START) || false,
217218
showExperimentalMissions: toBoolean(process.env.FT_SHOW_EXPERIMENTAL_MISSIONS),
218219
showNewCampaignPresentationPage: toBoolean(process.env.FT_SHOW_NEW_CAMPAIGN_PRESENTATION_PAGE),
219220
showNewResultPage: toBoolean(process.env.FT_SHOW_NEW_RESULT_PAGE),

0 commit comments

Comments
 (0)