[#393] gc: Use defer to mark handler done

Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
Dmitrii Stepanov 2023-05-25 16:12:46 +03:00 committed by Evgenii Stratonikov
parent 9119199f6e
commit 20a489bdb5

View file

@ -146,8 +146,8 @@ func (gc *gc) listenEvents(ctx context.Context) {
h := v.handlers[i]
err := gc.workerPool.Submit(func() {
defer v.prevGroup.Done()
h(runCtx, event)
v.prevGroup.Done()
})
if err != nil {
gc.log.Warn(logs.ShardCouldNotSubmitGCJobToWorkerPool,