Skip to content

Commit

Permalink
Keep the cancellable context from errgroup
Browse files Browse the repository at this point in the history
  • Loading branch information
mcastorina committed Jul 20, 2023
1 parent 3c8743c commit 44a9573
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/engine/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,10 @@ func Start(ctx context.Context, options ...EngineOption) *Engine {
}
ctx.Logger().V(2).Info("engine started", "workers", e.concurrency)

sourcesWg := &errgroup.Group{}
sourcesWg, egCtx := errgroup.WithContext(ctx)
sourcesWg.SetLimit(e.concurrency)
e.sourcesWg = sourcesWg
ctx = context.WithLogger(egCtx, ctx.Logger())

if len(e.decoders) == 0 {
e.decoders = decoders.DefaultDecoders()
Expand Down

0 comments on commit 44a9573

Please sign in to comment.