Module: deluge
Branch: chunked-sessionproxy-and-gtkui-speedups
Commit: ffd344d0b5ac883a38eb2968c53f6d05ba814e5c

Author: Pedro Algarvio <[email protected]>
Date:   Sun May  8 21:35:06 2011 +0100

On some "race" conditions, the torrent is removed before it's status could be 
retrieved. Return an empty status.

---

 deluge/core/core.py |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/deluge/core/core.py b/deluge/core/core.py
index 0df829b..716fdbc 100644
--- a/deluge/core/core.py
+++ b/deluge/core/core.py
@@ -412,7 +412,11 @@ class Core(component.Component):
     @export
     def get_torrent_status(self, torrent_id, keys, diff=False):
         # Build the status dictionary
-        status = self.torrentmanager[torrent_id].get_status(keys, diff)
+        try:
+            status = self.torrentmanager[torrent_id].get_status(keys, diff)
+        except KeyError:
+            # Torrent was probaly removed meanwhile
+            return {}
 
         # Get the leftover fields and ask the plugin manager to fill them
         leftover_fields = list(set(keys) - set(status.keys()))

-- 
You received this message because you are subscribed to the Google Groups 
"deluge-commit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/deluge-commit?hl=en.

Reply via email to