aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/pkg/pkg.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/pkg/pkg.go')
-rw-r--r--internal/pkg/pkg.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/internal/pkg/pkg.go b/internal/pkg/pkg.go
index 7b4c9637..f1e6279d 100644
--- a/internal/pkg/pkg.go
+++ b/internal/pkg/pkg.go
@@ -485,6 +485,16 @@ type KnownChecksum interface {
Checksum() Checksum
}
+// CuresExempt is optionally implemented for an artifact exempt to the
+// cache-wide cures counter and limit.
+type CuresExempt interface {
+ Artifact
+
+ // CuresExempt is a no-op function but serves to distinguish implementations
+ // that are cures-exempt.
+ CuresExempt()
+}
+
// FileArtifact refers to an [Artifact] backed by a single file.
//
// FileArtifact does not support fine-grained cancellation. Its context is
@@ -1892,6 +1902,10 @@ func (c *Cache) cure(a Artifact, curesExempt bool) (
}
}()
+ if _, ok := a.(CuresExempt); ok {
+ curesExempt = true
+ }
+
var (
ctx context.Context
done chan<- struct{}