mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-04 23:48:40 +00:00
Use flush_disk_cache as a shutdown marker
This is a hacky fix for waiting_on_resume_data not being empty on shutdown. This issue needs further investigating.
This commit is contained in:
parent
a65603e10c
commit
49c2be40ab
1 changed files with 13 additions and 6 deletions
|
@ -747,12 +747,19 @@ class TorrentManager(component.Component):
|
||||||
deferreds.append(d)
|
deferreds.append(d)
|
||||||
self.torrents[torrent_id].save_resume_data(flush_disk_cache)
|
self.torrents[torrent_id].save_resume_data(flush_disk_cache)
|
||||||
|
|
||||||
def on_all_resume_data_finished(result):
|
def on_all_resume_data_finished(dummy_result):
|
||||||
"""Saves resume data file when no more torrents waiting for resume data"""
|
"""Saves resume data file when no more torrents waiting for resume data
|
||||||
if result and not self.waiting_on_resume_data:
|
|
||||||
if self.save_resume_data_file():
|
Returns:
|
||||||
# Return True for the remove_temp_file() callback in stop()
|
bool: True if fastresume file is saved.
|
||||||
return True
|
|
||||||
|
Used by remove_temp_file callback in stop.
|
||||||
|
|
||||||
|
"""
|
||||||
|
# Use flush_disk_cache as a marker for shutdown so fastresume is
|
||||||
|
# saved even if torrents are waiting.
|
||||||
|
if not self.waiting_on_resume_data or flush_disk_cache:
|
||||||
|
return self.save_resume_data_file()
|
||||||
|
|
||||||
return DeferredList(deferreds).addBoth(on_all_resume_data_finished)
|
return DeferredList(deferreds).addBoth(on_all_resume_data_finished)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue