From cb7a2fb05bca833c39978f6236943fbe3f058a3c Mon Sep 17 00:00:00 2001 From: "Ronald A. Richardson" Date: Fri, 28 Nov 2025 18:10:24 +0800 Subject: [PATCH] minor syntax tweaks --- console/app/app.js | 1 - .../app/initializers/load-runtime-config.js | 23 +++++++++---------- console/config/environment.js | 2 +- console/package.json | 2 +- 4 files changed, 13 insertions(+), 15 deletions(-) diff --git a/console/app/app.js b/console/app/app.js index 7ad6bd28..03884696 100644 --- a/console/app/app.js +++ b/console/app/app.js @@ -11,5 +11,4 @@ export default class App extends Application { engines = {}; } -// Load all initializers (including our new load-runtime-config initializer) loadInitializers(App, config.modulePrefix); diff --git a/console/app/initializers/load-runtime-config.js b/console/app/initializers/load-runtime-config.js index ba062e3d..f88ccefd 100644 --- a/console/app/initializers/load-runtime-config.js +++ b/console/app/initializers/load-runtime-config.js @@ -3,33 +3,32 @@ import { debug } from '@ember/debug'; /** * Load Runtime Config Initializer - * + * * Loads runtime configuration from fleetbase.config.json before the application boots. * This must run first to ensure all config is available for other initializers. - * + * * Uses `before` to ensure it runs before any other initializers. - * + * * @export * @param {Application} application */ export function initialize(application) { const startTime = performance.now(); debug('[Initializer:load-runtime-config] Loading runtime configuration...'); - + // Defer readiness until config is loaded application.deferReadiness(); - - loadRuntimeConfig() - .then(() => { - const endTime = performance.now(); + (async () => { + try { + await loadRuntimeConfig(); debug(`[Initializer:load-runtime-config] Runtime config loaded in ${(endTime - startTime).toFixed(2)}ms`); application.advanceReadiness(); - }) - .catch((error) => { + } catch (error) { console.error('[Initializer:load-runtime-config] Failed to load runtime config:', error); // Still advance readiness to prevent hanging application.advanceReadiness(); - }); + } + })(); } export default { @@ -37,5 +36,5 @@ export default { initialize, // Run after intl polyfills are loaded, before socketcluster after: 'load-intl-polyfills', - before: 'load-socketcluster-client' + before: 'load-socketcluster-client', }; diff --git a/console/config/environment.js b/console/config/environment.js index c022df7d..7f8fcf06 100644 --- a/console/config/environment.js +++ b/console/config/environment.js @@ -21,7 +21,7 @@ module.exports = function (environment) { }, APP: { - autoboot: false, + autoboot: true, extensions: asArray(getenv('EXTENSIONS')), disableRuntimeConfig: toBoolean(getenv('DISABLE_RUNTIME_CONFIG')), }, diff --git a/console/package.json b/console/package.json index a4dd6c78..45016e5a 100644 --- a/console/package.json +++ b/console/package.json @@ -79,7 +79,7 @@ "broccoli-file-creator": "^2.1.1", "broccoli-funnel": "^3.0.8", "broccoli-merge-trees": "^4.2.0", - "chokidar": "^5.0.0", + "chokidar": "4.0.3", "concurrently": "^8.2.2", "date-fns": "^2.30.0", "dragula": "^3.7.3",