forked from TrueCloudLab/frostfs-node
[#1085] writecache: persist in-memory objects before shutdown
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
parent
3215210d0c
commit
0ef3d5ab03
4 changed files with 58 additions and 4 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue