Skip to content

Commit

Permalink
feat: show time info for upgrade scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
barisusakli committed Feb 25, 2021
1 parent 293b7c2 commit 14a6c34
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/upgrade.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ Upgrade.process = async function (files, skipCount) {
}

// Do the upgrade...
const upgradeStart = Date.now();
try {
await scriptExport.method.bind({
progress: progress,
Expand All @@ -161,8 +162,8 @@ Upgrade.process = async function (files, skipCount) {
console.error('Error occurred');
throw err;
}

process.stdout.write(' OK\n'.green);
const upgradeDuration = ((Date.now() - upgradeStart) / 1000).toFixed(2);
process.stdout.write(` OK (${upgradeDuration} seconds)\n`.green);

// Record success in schemaLog
await db.sortedSetAdd('schemaLog', Date.now(), path.basename(file, '.js'));
Expand Down

0 comments on commit 14a6c34

Please sign in to comment.