From a4fab678114b61c1c3473661577797ecf029514d Mon Sep 17 00:00:00 2001 From: Ophestra Date: Sat, 20 Jun 2026 01:03:28 +0900 Subject: internal/pkg: optionally exempt implementations from cures counter This avoids holding up many slots with a long pipeline. Signed-off-by: Ophestra --- internal/pkg/pkg.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'internal/pkg/pkg.go') 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{} -- cgit v1.3.1