mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-06 22:40:14 -05:00
Exposed async route settings loading method
refs https://linear.app/tryghost/issue/CORE-35/refactor-route-and-redirect-settings - There's no reason for the boot to block the event by loading route settings sychronously - The only leftover use of a sync loader might also be refactored in some way to avoid blocking the event loo - for example by caching the value on the service layer.
This commit is contained in:
parent
85f18850a9
commit
0586a73c6d
2 changed files with 2 additions and 1 deletions
|
@ -152,7 +152,7 @@ async function initDynamicRouting() {
|
|||
|
||||
// We pass the frontend API version + the dynamic routes here, so that the frontend services are slightly less tightly-coupled
|
||||
const apiVersion = bridge.getFrontendApiVersion();
|
||||
const routeSettings = routeSettingsService.loadRouteSettingsSync();
|
||||
const routeSettings = await routeSettingsService.loadRouteSettings();
|
||||
debug(`Frontend API Version: ${apiVersion}`);
|
||||
|
||||
routing.bootstrap.start(apiVersion, routeSettings);
|
||||
|
|
|
@ -146,6 +146,7 @@ const init = function () {
|
|||
|
||||
module.exports.init = init;
|
||||
module.exports.loadRouteSettingsSync = SettingsLoader.loadSettingsSync;
|
||||
module.exports.loadRouteSettings = SettingsLoader.loadSettings;
|
||||
|
||||
module.exports.api = {
|
||||
setFromFilePath: setFromFilePath,
|
||||
|
|
Loading…
Reference in a new issue