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