Use fsync() for more robust setting files saving

Bump base for util.fsyncOpenedFile() and util.fsyncDirectory().

Use these to force flush to storage device when
saving luasetting, docsetting, and history.lua.
Also dont rotate them to .old until they are at least
60 seconds old.
Also make auto_save_paging_count count right.

Also bump crengine: open (as text) small or empty files
This commit is contained in:
poire-z
2019-12-10 23:00:08 +01:00
parent 1e1ceedd4d
commit 04d9a557aa
7 changed files with 73 additions and 23 deletions

View File

@@ -928,11 +928,10 @@ function ReaderView:onReaderReady()
end
else
self.autoSaveSettings = function()
self.auto_save_paging_count = self.auto_save_paging_count + 1
if self.auto_save_paging_count == DAUTO_SAVE_PAGING_COUNT then
self.ui:saveSettings()
self.auto_save_paging_count = 0
else
self.auto_save_paging_count = self.auto_save_paging_count + 1
end
end
end