cli: persist restored blocks on exit

Add grace context to execute defer's on exit.
This commit is contained in:
Evgenii Stratonikov 2020-03-16 12:00:22 +03:00
parent 8cb9e1d85d
commit c880435c92
2 changed files with 15 additions and 6 deletions

View file

@ -111,10 +111,6 @@ func (d *dump) add(index uint32, batch *storage.MemBatch) {
}
func (d *dump) tryPersist(prefix string, index uint32) error {
if index%1000 != 0 {
return nil
}
f, err := createFile(prefix, index)
if err != nil {
return err