mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-08 15:05:46 +01:00
feat: show time info for upgrade scripts
This commit is contained in:
@@ -153,6 +153,7 @@ Upgrade.process = async function (files, skipCount) {
|
||||
}
|
||||
|
||||
// Do the upgrade...
|
||||
const upgradeStart = Date.now();
|
||||
try {
|
||||
await scriptExport.method.bind({
|
||||
progress: progress,
|
||||
@@ -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'));
|
||||
|
||||
Reference in New Issue
Block a user