[#585] writecache: Count items periodically

Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
Dmitrii Stepanov 2023-08-09 17:14:41 +03:00
parent d15199c5d8
commit eec97d177e
6 changed files with 55 additions and 42 deletions

View file

@ -107,13 +107,14 @@ func (c *cache) Open(readOnly bool) error {
// thus we need to create a channel here.
c.closeCh = make(chan struct{})
return metaerr.Wrap(c.initCounters())
return metaerr.Wrap(c.setCounters())
}
// Init runs necessary services.
func (c *cache) Init() error {
c.metrics.SetMode(c.mode)
c.runFlushLoop()
c.runDBCounterLoop()
return nil
}