Skip to content

Commit

Permalink
feat: use background context for long-running operation
Browse files Browse the repository at this point in the history
  • Loading branch information
rogercoll committed May 11, 2024
1 parent 2bf6a4a commit 6b568e2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion receiver/podmanreceiver/receiver.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ func (r *metricsReceiver) start(ctx context.Context, _ component.Host) error {
return err
}

cctx, cancel := context.WithCancel(ctx)
// context for long-running operation
cctx, cancel := context.WithCancel(context.Background())
r.cancel = cancel

go r.scraper.containerEventLoop(cctx)
Expand Down

0 comments on commit 6b568e2

Please sign in to comment.