forked from TrueCloudLab/frostfs-node
[#930] policer: Release task pool when context cancelled
Signed-off-by: Anton Nikiforov <an.nikiforov@yadro.com>
This commit is contained in:
parent
675eec91f3
commit
c441296592
1 changed files with 2 additions and 0 deletions
|
@ -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 a new issue