node: simplify upload-pack reader joining
The `join` method is equivalent to the custom loop that was written for joining the `reader` thread in upload-pack. Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com> X-Clacks-Overhead: GNU Terry Pratchett
This commit is contained in:
parent
740106d759
commit
de434bb437
|
|
@ -124,14 +124,10 @@ where
|
||||||
|
|
||||||
// N.b. we only care if the `reader` is finished. We then kill
|
// N.b. we only care if the `reader` is finished. We then kill
|
||||||
// the child which will end the thread for the sender.
|
// the child which will end the thread for the sender.
|
||||||
loop {
|
if let Err(e) = reader.join() {
|
||||||
if reader.is_finished() {
|
log::warn!(target: "worker", "Upload pack thread panicked: {e:?}");
|
||||||
child.kill()?;
|
|
||||||
break;
|
|
||||||
} else {
|
|
||||||
std::thread::sleep(std::time::Duration::from_millis(100));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
child.kill()?;
|
||||||
Ok::<_, io::Error>(())
|
Ok::<_, io::Error>(())
|
||||||
})?;
|
})?;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue