internal/pkg: optionally exempt implementations from cures counter
Test / Create distribution (push) Successful in 51s
Test / Sandbox (push) Successful in 2m49s
Test / ShareFS (push) Successful in 3m48s
Test / Hakurei (push) Successful in 3m59s
Test / Sandbox (race detector) (push) Successful in 5m23s
Test / Hakurei (race detector) (push) Successful in 6m39s
Test / Flake checks (push) Successful in 1m26s
Test / Create distribution (push) Successful in 51s
Test / Sandbox (push) Successful in 2m49s
Test / ShareFS (push) Successful in 3m48s
Test / Hakurei (push) Successful in 3m59s
Test / Sandbox (race detector) (push) Successful in 5m23s
Test / Hakurei (race detector) (push) Successful in 6m39s
Test / Flake checks (push) Successful in 1m26s
This avoids holding up many slots with a long pipeline. Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
@@ -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{}
|
||||
|
||||
Reference in New Issue
Block a user