Skip to content

Commit

Permalink
update check
Browse files Browse the repository at this point in the history
  • Loading branch information
klkvr committed Mar 12, 2024
1 parent 122c9e5 commit ae4e864
Showing 1 changed file with 3 additions and 21 deletions.
24 changes: 3 additions & 21 deletions src/cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -701,27 +701,9 @@ impl<'a, T: ArtifactOutput> ArtifactsCacheInner<'a, T> {

/// Returns whether we are missing artifacts for the given file and version.
fn is_missing_artifacts(&self, file: &Path, version: &Version) -> bool {
let Some(entry) = self.cache.entry(file) else {
trace!("missing cache entry");
return true;
};

if !entry.contains_version(version) {
trace!("missing linked artifacts",);
return true;
}

if entry.artifacts_for_version(version).any(|artifact_path| {
let missing_artifact = !self.cached_artifacts.has_artifact(artifact_path);
if missing_artifact {
trace!("missing artifact \"{}\"", artifact_path.display());
}
missing_artifact
}) {
return true;
}

false
self.cached_artifacts.get(&format!("{}", file.display())).map_or(true, |artifacts| {
!artifacts.values().flatten().any(|artifact| artifact.version == *version)
})
}

/// Returns a set of files that are dirty itself or import dirty file directly or indirectly.
Expand Down

0 comments on commit ae4e864

Please sign in to comment.