feat: show time info for upgrade scripts

v1.18.x
Barış Soner Uşaklı 4 years ago
parent 293b7c2650
commit 14a6c349c2

@ -153,6 +153,7 @@ Upgrade.process = async function (files, skipCount) {
} }
// Do the upgrade... // Do the upgrade...
const upgradeStart = Date.now();
try { try {
await scriptExport.method.bind({ await scriptExport.method.bind({
progress: progress, progress: progress,
@ -161,8 +162,8 @@ Upgrade.process = async function (files, skipCount) {
console.error('Error occurred'); console.error('Error occurred');
throw err; throw err;
} }
const upgradeDuration = ((Date.now() - upgradeStart) / 1000).toFixed(2);
process.stdout.write(' OK\n'.green); process.stdout.write(` OK (${upgradeDuration} seconds)\n`.green);
// Record success in schemaLog // Record success in schemaLog
await db.sortedSetAdd('schemaLog', Date.now(), path.basename(file, '.js')); await db.sortedSetAdd('schemaLog', Date.now(), path.basename(file, '.js'));

Loading…
Cancel
Save