1
0
Fork 0

Sync storage every second

This commit is contained in:
Gregory Eremin 2014-07-17 20:21:57 +07:00
parent 6864d90cca
commit b71def6cf3
2 changed files with 5 additions and 1 deletions

View File

@ -60,5 +60,9 @@ func KeepStatePersisted() {
for {
<-t.C
SaveState()
err := storage.Sync(false)
if err != nil {
Error(err, "Failed to sync storage")
}
}
}

View File

@ -33,7 +33,7 @@ func CloseStorage() {
err = storage.Sync(true)
if err != nil {
Error(err, "Failed to sync storage")
Error(err, "Failed to sync storage (hard)")
} else {
Log("Storage synchronized")
}