From d9367f5b202df0e0345b3cb5606719da31434b53 Mon Sep 17 00:00:00 2001 From: Hannah Wolfe Date: Tue, 18 May 2021 15:22:02 +0100 Subject: [PATCH] Added debug to gscan checks for timings - added a couple of extra debug calls to see how long gscan checks take in the boot process --- core/server/services/themes/validate.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/server/services/themes/validate.js b/core/server/services/themes/validate.js index 131cf4e2fd..df8d78369b 100644 --- a/core/server/services/themes/validate.js +++ b/core/server/services/themes/validate.js @@ -1,3 +1,4 @@ +const debug = require('ghost-ignition').debug('theme:validate'); const _ = require('lodash'); const Promise = require('bluebird'); const fs = require('fs-extra'); @@ -12,16 +13,19 @@ const canActivate = function canActivate(checkedTheme) { }; const check = function check(theme, isZip) { + debug('Begin: Check'); // gscan can slow down boot time if we require on boot, for now nest the require. const gscan = require('gscan'); let checkPromise; if (isZip) { + debug('zip mode'); checkPromise = gscan.checkZip(theme, { keepExtractedDir: true, checkVersion: 'canary' }); } else { + debug('non-zip mode'); checkPromise = gscan.check(theme.path, { checkVersion: 'canary' }); @@ -34,6 +38,7 @@ const check = function check(theme, isZip) { checkVersion: 'canary' }); + debug('End: Check'); return checkedTheme; }); };