on shutdown, dont create fast resumes for seeds or paused torrents and only pause if compact, since that's only when it's needed
This commit is contained in:
parent
cf8f7f0376
commit
7d9fee4946
@ -151,10 +151,15 @@ class TorrentManager(component.Component):
|
|||||||
def stop(self):
|
def stop(self):
|
||||||
# Save state on shutdown
|
# Save state on shutdown
|
||||||
self.save_state()
|
self.save_state()
|
||||||
# Pause all torrents and save the .fastresume files
|
|
||||||
self.pause_all()
|
|
||||||
for key in self.torrents.keys():
|
for key in self.torrents.keys():
|
||||||
self.torrents[key].write_fastresume()
|
if not self.torrents[key].handle.is_paused() and \
|
||||||
|
not self.torrents[key].handle.is_seed():
|
||||||
|
if self.torrents[key].get_status("compact"):
|
||||||
|
try:
|
||||||
|
self.torrents[key].pause()
|
||||||
|
except:
|
||||||
|
log.warning("Unable to pause torrent %s", key)
|
||||||
|
self.torrents[key].write_fastresume()
|
||||||
|
|
||||||
def __getitem__(self, torrent_id):
|
def __getitem__(self, torrent_id):
|
||||||
"""Return the Torrent with torrent_id"""
|
"""Return the Torrent with torrent_id"""
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user