[#323] cmd/node: Call Close method of the storage engine on app shutdown

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2021-01-18 12:04:58 +03:00 committed by Alex Vanin
parent 9f41192bff
commit cf00682065

View file

@ -453,6 +453,19 @@ func initLocalStorage(c *cfg) {
}
c.cfgObject.cfgLocalStorage.localStorage = ls
c.onShutdown(func() {
c.log.Info("closing components of the storage engine...")
err := ls.Close()
if err != nil {
c.log.Info("storage engine closing failure",
zap.String("error", err.Error()),
)
} else {
c.log.Info("all components of the storage engine closed successfully")
}
})
}
func initShardOptions(c *cfg) {