Merge branch 'end-filter-run' into 'master'
fix: allow cancelling the run_filters coroutine See merge request poezio/slixmpp!184
This commit is contained in:
commit
28fe68c7d3
@ -1239,7 +1239,7 @@ class XMLStream(asyncio.BaseProtocol):
|
|||||||
else:
|
else:
|
||||||
self.send_raw(data)
|
self.send_raw(data)
|
||||||
|
|
||||||
async def run_filters(self) -> NoReturn:
|
async def run_filters(self) -> None:
|
||||||
"""
|
"""
|
||||||
Background loop that processes stanzas to send.
|
Background loop that processes stanzas to send.
|
||||||
"""
|
"""
|
||||||
@ -1295,6 +1295,9 @@ class XMLStream(asyncio.BaseProtocol):
|
|||||||
self.send_raw(data)
|
self.send_raw(data)
|
||||||
except ContinueQueue as exc:
|
except ContinueQueue as exc:
|
||||||
log.debug('Stanza in send queue not sent: %s', exc)
|
log.debug('Stanza in send queue not sent: %s', exc)
|
||||||
|
except asyncio.CancelledError:
|
||||||
|
log.debug('Send coroutine received cancel(), stopping')
|
||||||
|
return
|
||||||
except Exception:
|
except Exception:
|
||||||
log.error('Exception raised in send queue:', exc_info=True)
|
log.error('Exception raised in send queue:', exc_info=True)
|
||||||
self.waiting_queue.task_done()
|
self.waiting_queue.task_done()
|
||||||
|
Loading…
Reference in New Issue
Block a user