Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: re-download the repodata cache if is out of sync/corrupt #466

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion crates/rattler_repodata_gateway/src/fetch/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -859,6 +859,7 @@ fn normalize_subdir_url(url: Url) -> Url {
}

/// A value returned from [`validate_cached_state`] which indicates the state of a repodata.json cache.
#[derive(Debug)]
enum ValidatedCacheState {
/// There is no cache, the cache could not be parsed, or the cache does not reference the same
/// request. We can completely ignore any cached data.
Expand Down Expand Up @@ -962,7 +963,7 @@ fn validate_cached_state(
tracing::warn!(
"BLAKE2 hash of repodata.json does not match cache state. Ignoring cached files..."
);
return ValidatedCacheState::Mismatched(cache_state);
return ValidatedCacheState::InvalidOrMissing;
}
}
}
Expand Down