@@ -596,8 +596,12 @@ impl<'a, Context: BuildContext> DistributionDatabase<'a, Context> {
596
596
CachedClientError :: Client ( err) => Error :: Client ( err) ,
597
597
} ) ?;
598
598
599
- // If the archive is missing the required hashes, force a refresh.
600
- let archive = if archive. has_digests ( hashes) {
599
+ // If the archive is missing the required hashes, or has since been removed, force a refresh.
600
+ let archive = Some ( archive)
601
+ . filter ( |archive| archive. has_digests ( hashes) )
602
+ . filter ( |archive| archive. exists ( self . build_context . cache ( ) ) ) ;
603
+
604
+ let archive = if let Some ( archive) = archive {
601
605
archive
602
606
} else {
603
607
self . client
@@ -746,12 +750,16 @@ impl<'a, Context: BuildContext> DistributionDatabase<'a, Context> {
746
750
CachedClientError :: Client ( err) => Error :: Client ( err) ,
747
751
} ) ?;
748
752
749
- // If the archive is missing the required hashes, force a refresh.
750
- let archive = if archive. has_digests ( hashes) {
753
+ // If the archive is missing the required hashes, or has since been removed, force a refresh.
754
+ let archive = Some ( archive)
755
+ . filter ( |archive| archive. has_digests ( hashes) )
756
+ . filter ( |archive| archive. exists ( self . build_context . cache ( ) ) ) ;
757
+
758
+ let archive = if let Some ( archive) = archive {
751
759
archive
752
760
} else {
753
761
self . client
754
- . managed ( |client| async move {
762
+ . managed ( |client| async {
755
763
client
756
764
. cached_client ( )
757
765
. skip_cache ( self . request ( url) ?, & http_entry, download)
0 commit comments