[#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 <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2021-02-16 14:38:34 +03:00 committed by Alex Vanin
parent 13087dc3dd
commit 4da41613c3

View file

@ -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
}