mirror of
https://github.com/astral-sh/uv.git
synced 2025-10-29 11:07:59 +00:00
Cancel waiting tasks on resolution error (#753)
## Summary I don't understand why this works (because I don't understand why it's erroring) but it does. See: https://github.com/astral-sh/puffin/pull/746#issuecomment-1875722454. ## Test Plan ``` cargo run --bin puffin pip-install requires-transitive-incompatible-with-transitive-8329cfc0 --extra-index-url https://test.pypi.org/simple -n ```
This commit is contained in:
parent
a8e52d2899
commit
cfffcbb269
3 changed files with 24 additions and 1 deletions
|
|
@ -24,3 +24,15 @@ pub(crate) struct Index {
|
|||
/// A map from source URL to precise URL.
|
||||
pub(crate) redirects: OnceMap<Url, Url>,
|
||||
}
|
||||
|
||||
impl Index {
|
||||
/// Cancel all waiting tasks.
|
||||
///
|
||||
/// Warning: waiting on tasks that have been canceled will cause the index to hang.
|
||||
pub(crate) fn cancel_all(&self) {
|
||||
self.packages.cancel_all();
|
||||
self.distributions.cancel_all();
|
||||
self.incompatibilities.cancel_all();
|
||||
self.redirects.cancel_all();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue