mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-08 01:18:39 +00:00
Change to using pop_alerts to get batches of alerts and save calls
Requires libtorrent >=0.16.7
This commit is contained in:
parent
937419bfcd
commit
31929c7004
1 changed files with 2 additions and 4 deletions
|
@ -118,9 +118,9 @@ class AlertManager(component.Component):
|
||||||
:param wait: bool, if True then the handler functions will be run right
|
:param wait: bool, if True then the handler functions will be run right
|
||||||
away and waited to return before processing the next alert
|
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
|
# Loop through all alerts in the queue
|
||||||
while alert is not None:
|
for alert in alerts:
|
||||||
alert_type = type(alert).__name__
|
alert_type = type(alert).__name__
|
||||||
# Display the alert message
|
# Display the alert message
|
||||||
if log.isEnabledFor(logging.DEBUG):
|
if log.isEnabledFor(logging.DEBUG):
|
||||||
|
@ -132,5 +132,3 @@ class AlertManager(component.Component):
|
||||||
self.delayed_calls.append(reactor.callLater(0, handler, alert))
|
self.delayed_calls.append(reactor.callLater(0, handler, alert))
|
||||||
else:
|
else:
|
||||||
handler(alert)
|
handler(alert)
|
||||||
|
|
||||||
alert = self.session.pop_alert()
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue