mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-06 22:40:14 -05:00
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
This commit is contained in:
parent
ae98bf5a6d
commit
d9367f5b20
1 changed files with 5 additions and 0 deletions
|
@ -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;
|
||||
});
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue