internal/pkg: pass context to file cure

This removes the left over embedded contexts.

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
2026-01-09 05:31:38 +09:00
parent f712466714
commit 34cb4ebd3b
7 changed files with 17 additions and 31 deletions

View File

@@ -265,7 +265,7 @@ type File interface {
// Callers must not modify the returned byte slice.
//
// Result must remain identical across multiple invocations.
Cure() ([]byte, error)
Cure(ctx context.Context) ([]byte, error)
Artifact
}
@@ -726,7 +726,7 @@ func (c *Cache) openFile(f File) (r io.ReadCloser, err error) {
return
}
var data []byte
if data, err = f.Cure(); err != nil {
if data, err = f.Cure(c.ctx); err != nil {
return
}
r = io.NopCloser(bytes.NewReader(data))
@@ -931,7 +931,7 @@ func (c *Cache) Cure(a Artifact) (
}
var data []byte
data, err = f.Cure()
data, err = f.Cure(c.ctx)
if err != nil {
return
}