summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCalum Lind <calumlind+deluge@gmail.com>2013-03-29 23:10:27 +0000
committerCalum Lind <calumlind+deluge@gmail.com>2013-03-29 23:14:18 +0000
commit31929c7004dd77d3c7b692f2f71c8dce8ecbcc5f (patch)
treea4ecc932ef8640a61a7b621a496d77d3df8787d5
parent937419bfcd15cc3e2919f607db267a7b94c9ff63 (diff)
downloaddeluge-31929c7004dd77d3c7b692f2f71c8dce8ecbcc5f.tar.gz
deluge-31929c7004dd77d3c7b692f2f71c8dce8ecbcc5f.tar.bz2
deluge-31929c7004dd77d3c7b692f2f71c8dce8ecbcc5f.zip
Change to using pop_alerts to get batches of alerts and save calls
Requires libtorrent >=0.16.7
-rw-r--r--deluge/core/alertmanager.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/deluge/core/alertmanager.py b/deluge/core/alertmanager.py
index bcc60fedf..ed19a9995 100644
--- a/deluge/core/alertmanager.py
+++ b/deluge/core/alertmanager.py
@@ -118,9 +118,9 @@ class AlertManager(component.Component):
:param wait: bool, if True then the handler functions will be run right
away and waited to return before processing the next alert
"""
- alert = self.session.pop_alert()
+ alerts = self.session.pop_alerts()
# Loop through all alerts in the queue
- while alert is not None:
+ for alert in alerts:
alert_type = type(alert).__name__
# Display the alert message
if log.isEnabledFor(logging.DEBUG):
@@ -132,5 +132,3 @@ class AlertManager(component.Component):
self.delayed_calls.append(reactor.callLater(0, handler, alert))
else:
handler(alert)
-
- alert = self.session.pop_alert()