mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-02 22:48:40 +00:00
Catch & log KeyError when removing a torrent from the queued torrents set
This seems to happen due to libtorrent firing the torrent finished event twice.
This commit is contained in:
parent
438dff177c
commit
914413c88f
2 changed files with 13 additions and 2 deletions
|
@ -1,3 +1,7 @@
|
||||||
|
=== Deluge 1.3.6 (In Development) ===
|
||||||
|
==== Core ====
|
||||||
|
* Catch & log KeyError when removing a torrent from the queued torrents set
|
||||||
|
|
||||||
=== Deluge 1.3.5 (09 April 2012) ===
|
=== Deluge 1.3.5 (09 April 2012) ===
|
||||||
==== Core ====
|
==== Core ====
|
||||||
* Fix not properly detecting when torrent is at end of queue
|
* Fix not properly detecting when torrent is at end of queue
|
||||||
|
|
|
@ -590,7 +590,10 @@ class TorrentManager(component.Component):
|
||||||
|
|
||||||
# Remove from set if it wasn't finished
|
# Remove from set if it wasn't finished
|
||||||
if not self.torrents[torrent_id].is_finished:
|
if not self.torrents[torrent_id].is_finished:
|
||||||
self.queued_torrents.remove(torrent_id)
|
try:
|
||||||
|
self.queued_torrents.remove(torrent_id)
|
||||||
|
except KeyError:
|
||||||
|
log.debug("%s isn't in queued torrents set?", torrent_id)
|
||||||
|
|
||||||
# Remove the torrent from deluge's session
|
# Remove the torrent from deluge's session
|
||||||
try:
|
try:
|
||||||
|
@ -893,7 +896,11 @@ class TorrentManager(component.Component):
|
||||||
torrent.update_state()
|
torrent.update_state()
|
||||||
|
|
||||||
# Torrent is no longer part of the queue
|
# Torrent is no longer part of the queue
|
||||||
self.queued_torrents.remove(torrent_id)
|
try:
|
||||||
|
self.queued_torrents.remove(torrent_id)
|
||||||
|
except KeyError:
|
||||||
|
# Sometimes libtorrent fires a TorrentFinishedEvent twice
|
||||||
|
log.debug("%s isn't in queued torrents set?", torrent_id)
|
||||||
|
|
||||||
# Only save resume data if it was actually downloaded something. Helps
|
# Only save resume data if it was actually downloaded something. Helps
|
||||||
# on startup with big queues with lots of seeding torrents. Libtorrent
|
# on startup with big queues with lots of seeding torrents. Libtorrent
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue