forked from TrueCloudLab/frostfs-node
[#930] policer: Release task pool when context cancelled
Signed-off-by: Anton Nikiforov <an.nikiforov@yadro.com>bugfix/namespace_require
parent
675eec91f3
commit
c441296592
|
@ -19,6 +19,7 @@ func (p *Policer) shardPolicyWorker(ctx context.Context) {
|
|||
for {
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
p.taskPool.Release()
|
||||
return
|
||||
default:
|
||||
}
|
||||
|
@ -36,6 +37,7 @@ func (p *Policer) shardPolicyWorker(ctx context.Context) {
|
|||
for i := range addrs {
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
p.taskPool.Release()
|
||||
return
|
||||
default:
|
||||
addr := addrs[i]
|
||||
|
|
Loading…
Reference in New Issue