mirror of
https://github.com/codex-storage/deluge.git
synced 2025-02-20 15:18:20 +00:00
[Core] Supress state warnings with fresh config
This commit is contained in:
parent
aedb59f854
commit
f4dce731e9
@ -742,6 +742,7 @@ class TorrentManager(component.Component):
|
|||||||
with open(_filepath, "rb") as _file:
|
with open(_filepath, "rb") as _file:
|
||||||
resume_data = lt.bdecode(_file.read())
|
resume_data = lt.bdecode(_file.read())
|
||||||
except (IOError, EOFError, RuntimeError) as ex:
|
except (IOError, EOFError, RuntimeError) as ex:
|
||||||
|
if self.torrents:
|
||||||
log.warning("Unable to load %s: %s", _filepath, ex)
|
log.warning("Unable to load %s: %s", _filepath, ex)
|
||||||
resume_data = None
|
resume_data = None
|
||||||
else:
|
else:
|
||||||
@ -756,6 +757,9 @@ class TorrentManager(component.Component):
|
|||||||
|
|
||||||
def save_resume_data_file(self):
|
def save_resume_data_file(self):
|
||||||
"""Saves the resume data file with the contents of self.resume_data"""
|
"""Saves the resume data file with the contents of self.resume_data"""
|
||||||
|
if not self.resume_data:
|
||||||
|
return True
|
||||||
|
|
||||||
filename = "torrents.fastresume"
|
filename = "torrents.fastresume"
|
||||||
filepath = os.path.join(self.state_dir, filename)
|
filepath = os.path.join(self.state_dir, filename)
|
||||||
filepath_bak = filepath + ".bak"
|
filepath_bak = filepath + ".bak"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user