[#1085] writecache: persist in-memory objects before shutdown

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
Evgenii Stratonikov 2022-01-18 17:27:07 +03:00 committed by LeL
parent 3215210d0c
commit 0ef3d5ab03
4 changed files with 58 additions and 4 deletions

View file

@ -140,6 +140,9 @@ func (c *cache) Init() error {
// Close closes db connection and stops services. Executes ObjectCounters.FlushAndClose op.
func (c *cache) Close() error {
// Finish all in-progress operations.
c.SetMode(ModeReadOnly)
close(c.closeCh)
c.objCounters.FlushAndClose()
return c.db.Close()