minor syntax tweaks

This commit is contained in:
Ronald A. Richardson
2025-11-28 18:10:24 +08:00
parent fd569cfeaf
commit cb7a2fb05b
4 changed files with 13 additions and 15 deletions

View File

@@ -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);

View File

@@ -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',
};

View File

@@ -21,7 +21,7 @@ module.exports = function (environment) {
},
APP: {
autoboot: false,
autoboot: true,
extensions: asArray(getenv('EXTENSIONS')),
disableRuntimeConfig: toBoolean(getenv('DISABLE_RUNTIME_CONFIG')),
},

View File

@@ -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",