mirror of
https://github.com/codex-storage/deluge.git
synced 2025-02-05 08:03:40 +00:00
Save .fastresume files on shutdown.
This commit is contained in:
parent
78244649b8
commit
4401c8f238
@ -157,9 +157,9 @@ class Core(dbus.service.Object):
|
|||||||
"""This is called by a thread from shutdown()"""
|
"""This is called by a thread from shutdown()"""
|
||||||
log.info("Shutting down core..")
|
log.info("Shutting down core..")
|
||||||
self.loop.quit()
|
self.loop.quit()
|
||||||
del self.torrents
|
|
||||||
self.plugins.shutdown()
|
self.plugins.shutdown()
|
||||||
del self.plugins
|
del self.plugins
|
||||||
|
del self.torrents
|
||||||
# Make sure the config file has been saved
|
# Make sure the config file has been saved
|
||||||
self.config.save()
|
self.config.save()
|
||||||
del self.config
|
del self.config
|
||||||
|
@ -77,7 +77,11 @@ class TorrentManager:
|
|||||||
log.debug("TorrentManager shutting down..")
|
log.debug("TorrentManager shutting down..")
|
||||||
# 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():
|
||||||
|
self.write_fastresume(key)
|
||||||
|
|
||||||
def __getitem__(self, torrent_id):
|
def __getitem__(self, torrent_id):
|
||||||
"""Return the Torrent with torrent_id"""
|
"""Return the Torrent with torrent_id"""
|
||||||
return self.torrents[torrent_id]
|
return self.torrents[torrent_id]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user