From 4da41613c31540bfe6fa2175d90c8a5313a000c0 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Tue, 16 Feb 2021 14:38:34 +0300 Subject: [PATCH] [#378] shard: Initialize GC processes on Init `Shard.Init` method creates a new GC instance from shard configuration and starts GC's workers through `init` call. In initial implementation GC routines are indefinite and can be killed only with by application shutdown. Signed-off-by: Leonard Lyubich --- pkg/local_object_storage/shard/control.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkg/local_object_storage/shard/control.go b/pkg/local_object_storage/shard/control.go index 45ae49fec7..a842ef4c2e 100644 --- a/pkg/local_object_storage/shard/control.go +++ b/pkg/local_object_storage/shard/control.go @@ -39,6 +39,14 @@ func (s *Shard) Init() error { } } + gc := &gc{ + gcCfg: s.gcCfg, + remover: s.removeGarbage, + mEventHandler: map[eventType]*eventHandlers{}, + } + + gc.init() + return nil }