Save .fastresume files on shutdown.

This commit is contained in:
Andrew Resch 2007-09-26 01:27:38 +00:00
parent 78244649b8
commit 4401c8f238
2 changed files with 6 additions and 2 deletions

View File

@ -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

View File

@ -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]