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 {
|
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]
|
||||||
|
|
Loading…
Reference in a new issue