internal/pkg: expose status file
All checks were successful
Test / Create distribution (push) Successful in 34s
Test / Sandbox (push) Successful in 2m34s
Test / Hakurei (push) Successful in 3m45s
Test / ShareFS (push) Successful in 3m51s
Test / Sandbox (race detector) (push) Successful in 4m57s
Test / Hakurei (race detector) (push) Successful in 5m55s
Test / Flake checks (push) Successful in 1m42s
All checks were successful
Test / Create distribution (push) Successful in 34s
Test / Sandbox (push) Successful in 2m34s
Test / Hakurei (push) Successful in 3m45s
Test / ShareFS (push) Successful in 3m51s
Test / Sandbox (race detector) (push) Successful in 4m57s
Test / Hakurei (race detector) (push) Successful in 5m55s
Test / Flake checks (push) Successful in 1m42s
This is useful for external tooling. Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
@@ -1790,6 +1790,18 @@ func (pending *pendingArtifactDep) cure(c *Cache) {
|
||||
pending.errsMu.Unlock()
|
||||
}
|
||||
|
||||
// OpenStatus attempts to open the status file associated to an [Artifact]. If
|
||||
// err is nil, the caller must close the resulting reader.
|
||||
func (c *Cache) OpenStatus(a Artifact) (r io.ReadSeekCloser, err error) {
|
||||
c.identMu.RLock()
|
||||
r, err = os.Open(c.base.Append(
|
||||
dirStatus,
|
||||
Encode(c.Ident(a).Value())).String(),
|
||||
)
|
||||
c.identMu.RUnlock()
|
||||
return
|
||||
}
|
||||
|
||||
// Close cancels all pending cures and waits for them to clean up.
|
||||
func (c *Cache) Close() {
|
||||
c.closeOnce.Do(func() {
|
||||
|
||||
Reference in New Issue
Block a user