wrangler: fix crash

This commit is contained in:
Starbeamrainbowlabs 2022-08-10 17:05:01 +01:00
parent 0bac8c8c0c
commit 50f214450f
Signed by: sbrl
GPG key ID: 1BE5172E637709C2

View file

@ -39,7 +39,10 @@ export default async function(dirpath_source, dirpath_target) {
update_progress();
}
files_complete++;
l.log(`converted ${filename}: ${lines_done} lines @ ${pretty_ms((new Date() - time_start) / lines_done)}`);
l.info(`DEBUG lines_done`, lines_done);
const time_per_line = (new Date() - time_start) / (lines_done === 0 ? 1 : lines_done);
l.log(`converted ${filename}: ${lines_done} lines @ ${pretty_ms(time_per_line)}/line`);
}, { concurrency: os.cpus().length });
update_progress_force();
l.log(`complete: ${lines_processed}/${files_complete} lines/files processed in ${pretty_ms(new Date() - time_start)}`);