diff --git a/pkg/services/policer/process.go b/pkg/services/policer/process.go index 1f35630fd3..c48f6064c9 100644 --- a/pkg/services/policer/process.go +++ b/pkg/services/policer/process.go @@ -27,6 +27,12 @@ func (p *Policer) shardPolicyWorker(ctx context.Context) { ) for { + select { + case <-ctx.Done(): + return + default: + } + addrs, cursor, err = p.jobQueue.Select(cursor, p.batchSize) if err != nil { if errors.Is(err, engine.ErrEndOfListing) {