[#378] shard/gc: Avoid usage of the range-loop vars in go-routines
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
b644589bb4
commit
ff442e9559
1 changed files with 3 additions and 1 deletions
|
@ -123,7 +123,9 @@ func (gc *gc) listenEvents() {
|
|||
|
||||
v.prevGroup.Add(len(v.handlers))
|
||||
|
||||
for _, h := range v.handlers {
|
||||
for i := range v.handlers {
|
||||
h := v.handlers[i]
|
||||
|
||||
err := gc.workerPool.Submit(func() {
|
||||
h(ctx, event)
|
||||
v.prevGroup.Done()
|
||||
|
|
Loading…
Reference in a new issue