From 74c9ba8f348e2dee01663c32fd15e60ffd4234b7 Mon Sep 17 00:00:00 2001 From: Thomas Lam <79589038+tl-hbk@users.noreply.github.com> Date: Wed, 27 Nov 2024 15:01:55 -0600 Subject: [PATCH] fix: clear gateway cache to drop SparseRepodata and associated locks --- src/render/solver.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/render/solver.rs b/src/render/solver.rs index c2a888d6..855080d0 100644 --- a/src/render/solver.rs +++ b/src/render/solver.rs @@ -12,6 +12,7 @@ use indicatif::{HumanBytes, ProgressBar, ProgressStyle}; use itertools::Itertools; use rattler::install::{DefaultProgressFormatter, IndicatifReporter, Installer}; use rattler_conda_types::{Channel, ChannelUrl, MatchSpec, Platform, RepoDataRecord}; +use rattler_repodata_gateway::SubdirSelection; use rattler_solve::{resolvo::Solver, ChannelPriority, SolveStrategy, SolverImpl, SolverTask}; use url::Url; @@ -260,7 +261,7 @@ pub async fn load_repodatas( let result = tool_configuration .repodata_gateway .query( - channels, + channels.clone(), [target_platform, Platform::NoArch], specs.to_vec(), ) @@ -291,6 +292,12 @@ pub async fn load_repodatas( .clear() .unwrap(); + for channel in &channels { + tool_configuration + .repodata_gateway + .clear_repodata_cache(channel, SubdirSelection::All); + } + Ok(result) }