Wait for the progressor to finish

This commit is contained in:
2026-04-27 11:11:17 +02:00
parent a6e3471181
commit 8b7d76017f

View File

@@ -54,11 +54,15 @@ fn main() -> Result<(), Box<dyn Error>> {
} else { } else {
Box::new(log::Progressor::new(rx)) Box::new(log::Progressor::new(rx))
}; };
thread::spawn(move || pr.run()); let handle = thread::spawn(move || pr.run());
builder = builder.sender(tx); builder = builder.sender(tx);
let job = builder.build()?; // Create the job in a block so the sender is dropped before
job.run(!args.dry_run)?; // joining the progress thread, allowing it to exit cleanly.
{
let job = builder.build()?;
job.run(!args.dry_run)?;
}
handle.join().unwrap();
Ok(()) Ok(())
} }