mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-08 23:15:48 +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...
|
// 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'));
|
||||||
|
|||||||
Reference in New Issue
Block a user