mirror of
https://github.com/fleetbase/fleetbase.git
synced 2025-12-19 14:18:57 +00:00
minor syntax tweaks
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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',
|
||||
};
|
||||
|
||||
@@ -21,7 +21,7 @@ module.exports = function (environment) {
|
||||
},
|
||||
|
||||
APP: {
|
||||
autoboot: false,
|
||||
autoboot: true,
|
||||
extensions: asArray(getenv('EXTENSIONS')),
|
||||
disableRuntimeConfig: toBoolean(getenv('DISABLE_RUNTIME_CONFIG')),
|
||||
},
|
||||
|
||||
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user