From f866ec13999fd108c571d7a1d74eba1af93f2336 Mon Sep 17 00:00:00 2001 From: Dmitrii Stepanov Date: Thu, 25 May 2023 12:28:29 +0300 Subject: [PATCH] [#392] gc: Use defer to mark handler done Signed-off-by: Dmitrii Stepanov --- pkg/local_object_storage/shard/gc.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/local_object_storage/shard/gc.go b/pkg/local_object_storage/shard/gc.go index 254a7ced71..8370d8fb8c 100644 --- a/pkg/local_object_storage/shard/gc.go +++ b/pkg/local_object_storage/shard/gc.go @@ -145,8 +145,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("could not submit GC job to worker pool",