gator
gator copied to clipboard
Refactor logic for cached packages to make more efficient
[nitpick] The logic for checking cached packages is inefficient. The early return on line 883-885 happens before cancelling tasks, but then lines 887-888 cancel tasks before making a new request. This means if force=false and cache exists, we return early (good), but if force=true, we always cancel and fetch even if a fetch is already in progress. Consider restructuring to avoid unnecessary cancellations when a request is already pending.
Originally posted by @Copilot in https://github.com/mamba-org/gator/pull/342#discussion_r2605298424