diff options
Diffstat (limited to 'internal/importer')
-rw-r--r-- | internal/importer/main.go | 4 | ||||
-rw-r--r-- | internal/importer/options.go | 4 | ||||
-rw-r--r-- | internal/importer/package.go | 4 |
3 files changed, 4 insertions, 8 deletions
diff --git a/internal/importer/main.go b/internal/importer/main.go index 6be5b45..bd41af2 100644 --- a/internal/importer/main.go +++ b/internal/importer/main.go @@ -28,7 +28,7 @@ func createSourceImporter( "fetcher", source.Fetcher.String(), "timeout", - source.FetchTimeout.Duration, + source.Timeout.Duration, ) logger.Debug("starting fetcher") @@ -42,7 +42,7 @@ func createSourceImporter( sourceMeta.Updated = time.Time{} } previousUpdate := sourceMeta.Updated - ctx, cancel := context.WithTimeout(parent, source.FetchTimeout.Duration) + ctx, cancel := context.WithTimeout(parent, source.Timeout.Duration) defer cancel() files, err := fetcher.FetchIfNeeded(ctx, &sourceMeta) diff --git a/internal/importer/options.go b/internal/importer/options.go index 4089f62..c26836e 100644 --- a/internal/importer/options.go +++ b/internal/importer/options.go @@ -87,8 +87,7 @@ func NewOptionProcessor(infile io.ReadCloser, source *config.Source) (*OptionIng return &i, nil } -func (i *OptionIngester) Process(parent context.Context) (<-chan nix.Importable, <-chan error) { - ctx, cancel := context.WithTimeout(parent, i.source.ImportTimeout.Duration) +func (i *OptionIngester) Process(ctx context.Context) (<-chan nix.Importable, <-chan error) { results := make(chan nix.Importable) errs := make(chan error) @@ -96,7 +95,6 @@ func (i *OptionIngester) Process(parent context.Context) (<-chan nix.Importable, defer i.infile.Close() defer close(results) defer close(errs) - defer cancel() outer: for mv := range i.dec.Stream() { diff --git a/internal/importer/package.go b/internal/importer/package.go index 3fee8d7..4e193db 100644 --- a/internal/importer/package.go +++ b/internal/importer/package.go @@ -104,8 +104,7 @@ func convertToLicense(in map[string]any) *nix.License { return l } -func (i *PackageIngester) Process(parent context.Context) (<-chan nix.Importable, <-chan error) { - ctx, cancel := context.WithTimeout(parent, i.source.ImportTimeout.Duration) +func (i *PackageIngester) Process(ctx context.Context) (<-chan nix.Importable, <-chan error) { results := make(chan nix.Importable) errs := make(chan error) @@ -113,7 +112,6 @@ func (i *PackageIngester) Process(parent context.Context) (<-chan nix.Importable defer i.infile.Close() defer close(results) defer close(errs) - defer cancel() outer: for mv := range i.dec.Stream() { |