[#204] gc: Fix GC handlers start
All checks were successful
ci/woodpecker/push/pre-commit Pipeline was successful
All checks were successful
ci/woodpecker/push/pre-commit Pipeline was successful
Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
parent
0948a280fa
commit
8e5a0dcf27
1 changed files with 3 additions and 2 deletions
|
@ -136,7 +136,8 @@ func (gc *gc) listenEvents(ctx context.Context) {
|
|||
v.cancelFunc()
|
||||
v.prevGroup.Wait()
|
||||
|
||||
ctx, v.cancelFunc = context.WithCancel(ctx)
|
||||
var runCtx context.Context
|
||||
runCtx, v.cancelFunc = context.WithCancel(ctx)
|
||||
|
||||
v.prevGroup.Add(len(v.handlers))
|
||||
|
||||
|
@ -144,7 +145,7 @@ func (gc *gc) listenEvents(ctx context.Context) {
|
|||
h := v.handlers[i]
|
||||
|
||||
err := gc.workerPool.Submit(func() {
|
||||
h(ctx, event)
|
||||
h(runCtx, event)
|
||||
v.prevGroup.Done()
|
||||
})
|
||||
if err != nil {
|
||||
|
|
Loading…
Reference in a new issue