Skip to content

Commit

Permalink
Add feature toggle to be able to disable ecosystem pre-loading before…
Browse files Browse the repository at this point in the history
… start
  • Loading branch information
Mefl committed Nov 6, 2024
1 parent 8113aea commit 598547a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion api/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ validateEnvironmentVariables();

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

const start = async function () {
await _setupEcosystem();
if (config.featureToggles.setupEcosystemBeforeStart) {
await _setupEcosystem();
}
server = await createServer();
await server.start();
};
Expand Down
1 change: 1 addition & 0 deletions api/src/shared/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ const configuration = (function () {
isQuestEnabled: toBoolean(process.env.FT_ENABLE_QUESTS),
isTextToSpeechButtonEnabled: toBoolean(process.env.FT_ENABLE_TEXT_TO_SPEECH_BUTTON),
isV3EligibilityCheckEnabled: toBoolean(process.env.FT_ENABLE_V3_ELIGIBILITY_CHECK),
setupEcosystemBeforeStart: toBoolean(process.env.FT_SETUP_ECOSYSTEM_BEFORE_START) || false,
showExperimentalMissions: toBoolean(process.env.FT_SHOW_EXPERIMENTAL_MISSIONS),
showNewCampaignPresentationPage: toBoolean(process.env.FT_SHOW_NEW_CAMPAIGN_PRESENTATION_PAGE),
showNewResultPage: toBoolean(process.env.FT_SHOW_NEW_RESULT_PAGE),
Expand Down

0 comments on commit 598547a

Please sign in to comment.