mirror of
https://github.com/codex-storage/deluge.git
synced 2025-01-12 20:44:50 +00:00
Make sure config files, resume data and state are fsync'd when saved. This should help prevent data
losses on crashes/improper shutdowns.
This commit is contained in:
parent
8f4583bc23
commit
3cab036b70
@ -541,6 +541,8 @@ class TorrentManager(component.Component):
|
||||
os.path.join(self.config["state_location"], "torrents.state.new"),
|
||||
"wb")
|
||||
cPickle.dump(state, state_file)
|
||||
state_file.flush()
|
||||
os.fsync(state_file.fileno())
|
||||
state_file.close()
|
||||
except IOError:
|
||||
log.warning("Unable to save state file.")
|
||||
|
Loading…
x
Reference in New Issue
Block a user