mirror of
https://github.com/codex-storage/deluge.git
synced 2025-01-27 11:45:44 +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()"""
|
||||
log.info("Shutting down core..")
|
||||
self.loop.quit()
|
||||
del self.torrents
|
||||
self.plugins.shutdown()
|
||||
del self.plugins
|
||||
del self.torrents
|
||||
# Make sure the config file has been saved
|
||||
self.config.save()
|
||||
del self.config
|
||||
|
@ -77,7 +77,11 @@ class TorrentManager:
|
||||
log.debug("TorrentManager shutting down..")
|
||||
# Save state on shutdown
|
||||
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):
|
||||
"""Return the Torrent with torrent_id"""
|
||||
return self.torrents[torrent_id]
|
||||
|
Loading…
x
Reference in New Issue
Block a user