mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-03-11 02:12:21 -05:00
Added metric collection for URL service initialization time
- this should help us get more visibility into the URL service and the effect it has on bootup time
This commit is contained in:
parent
d4860e7fe3
commit
7ea1c2591b
1 changed files with 2 additions and 0 deletions
|
@ -105,11 +105,13 @@ async function initCore({ghostServer, config, bootLogger, frontend}) {
|
||||||
// The URLService is a core part of Ghost, which depends on models.
|
// The URLService is a core part of Ghost, which depends on models.
|
||||||
debug('Begin: Url Service');
|
debug('Begin: Url Service');
|
||||||
const urlService = require('./server/services/url');
|
const urlService = require('./server/services/url');
|
||||||
|
const urlServiceStart = Date.now();
|
||||||
// Note: there is no await here, we do not wait for the url service to finish
|
// Note: there is no await here, we do not wait for the url service to finish
|
||||||
// We can return, but the site will remain in maintenance mode until this finishes
|
// We can return, but the site will remain in maintenance mode until this finishes
|
||||||
// This is managed on request: https://github.com/TryGhost/Ghost/blob/main/core/app.js#L10
|
// This is managed on request: https://github.com/TryGhost/Ghost/blob/main/core/app.js#L10
|
||||||
urlService.init({
|
urlService.init({
|
||||||
onFinished: () => {
|
onFinished: () => {
|
||||||
|
bootLogger.metric('url-service', urlServiceStart);
|
||||||
bootLogger.log('URL Service Ready');
|
bootLogger.log('URL Service Ready');
|
||||||
},
|
},
|
||||||
urlCache: !frontend // hacky parameter to make the cache initialization kick in as we can't initialize labs before the boot
|
urlCache: !frontend // hacky parameter to make the cache initialization kick in as we can't initialize labs before the boot
|
||||||
|
|
Loading…
Add table
Reference in a new issue