[#930] policer: Release task pool when context cancelled

Signed-off-by: Anton Nikiforov <an.nikiforov@yadro.com>
This commit is contained in:
Anton Nikiforov 2024-01-24 14:48:47 +03:00 committed by Evgenii Stratonikov
parent 675eec91f3
commit c441296592

View file

@ -19,6 +19,7 @@ func (p *Policer) shardPolicyWorker(ctx context.Context) {
for { for {
select { select {
case <-ctx.Done(): case <-ctx.Done():
p.taskPool.Release()
return return
default: default:
} }
@ -36,6 +37,7 @@ func (p *Policer) shardPolicyWorker(ctx context.Context) {
for i := range addrs { for i := range addrs {
select { select {
case <-ctx.Done(): case <-ctx.Done():
p.taskPool.Release()
return return
default: default:
addr := addrs[i] addr := addrs[i]