Skip to content

Commit 3b0ce26

Browse files
committed
chore: display numbering to track progress
1 parent f409414 commit 3b0ce26

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

scripts/version-migrate-run.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -387,15 +387,21 @@ async function main() {
387387
console.log(`File IDs to process: ${fileIds.length} (concurrency: ${CONCURRENCY})`);
388388
console.log('');
389389

390+
const total = fileIds.length;
391+
let completed = 0;
390392
const startMs = Date.now();
391393
const results = await runWithConcurrency(CONCURRENCY, fileIds, async (fileId) => {
392394
try {
393395
const result = await withRetry(() => migrateFileId(fileId), fileId);
396+
completed += 1;
397+
const idx = completed;
394398
const pathHint = result.path ? ` (${result.path})` : '';
395-
console.log(` ${fileId}${pathHint}: ${result.snapshots} snapshots, ${result.auditLines} audit lines -> repo ${result.repo}`);
399+
console.log(`${idx} / ${total} - ${fileId}${pathHint}: ${result.snapshots} snapshots, ${result.auditLines} audit lines -> repo ${result.repo}`);
396400
return { fileId, ...result, error: null };
397401
} catch (e) {
398-
console.error(` ${fileId}: ERROR - ${e.message}`);
402+
completed += 1;
403+
const idx = completed;
404+
console.error(`${idx} / ${total} - ${fileId}: ERROR - ${e.message}`);
399405
console.error(e);
400406
return {
401407
fileId, snapshots: 0, audit: 0, auditLines: 0, repo: '', error: e,

0 commit comments

Comments
 (0)