mirror of https://github.com/astral-sh/uv
Avoid panics due to reads on failed requests (#17098)
Fixes https://github.com/astral-sh/uv/issues/17090, specifically the panic, not the upstream bug.
This commit is contained in:
parent
7ad441a0bd
commit
3e80b10272
|
|
@ -297,7 +297,13 @@ impl ProgressReporter {
|
||||||
return;
|
return;
|
||||||
};
|
};
|
||||||
|
|
||||||
state.lock().unwrap().bars[&id].inc(bytes);
|
// Avoid panics due to reads on failed requests.
|
||||||
|
// https://github.com/astral-sh/uv/issues/17090
|
||||||
|
// TODO(konsti): Add a debug assert once https://github.com/seanmonstar/reqwest/issues/2884
|
||||||
|
// is fixed
|
||||||
|
if let Some(bar) = state.lock().unwrap().bars.get(&id) {
|
||||||
|
bar.inc(bytes);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn on_request_complete(&self, direction: Direction, id: usize) {
|
fn on_request_complete(&self, direction: Direction, id: usize) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue