[#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>
remotes/KirillovDenis/release/v0.21.1
Leonard Lyubich 2021-02-16 14:38:34 +03:00 committed by Alex Vanin
parent 13087dc3dd
commit 4da41613c3
1 changed files with 8 additions and 0 deletions

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
}