refactor: separate fetch and import logic
1 file changed, 3 insertions(+), 3 deletions(-)
changed files
M internal/importer/ingest.go → internal/importer/options.go
@@ -91,9 +91,8 @@ return &i, nil } -func (i *OptionIngester) Process( - ctx context.Context, -) (<-chan nix.Importable, <-chan error) { +func (i *OptionIngester) Process(parent context.Context) (<-chan nix.Importable, <-chan error) { + ctx, cancel := context.WithTimeout(parent, i.source.ImportTimeout) results := make(chan nix.Importable) errs := make(chan error)@@ -101,6 +100,7 @@ go func() { defer i.infile.Close() defer close(results) defer close(errs) + defer cancel() slog.Debug("starting decoder stream") outer: