Wait for the progressor to finish
This commit is contained in:
@@ -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);
|
||||||
|
|
||||||
|
// 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()?;
|
let job = builder.build()?;
|
||||||
job.run(!args.dry_run)?;
|
job.run(!args.dry_run)?;
|
||||||
|
}
|
||||||
|
handle.join().unwrap();
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user