Skip to content

Commit

Permalink
silence unnecessary logging of CancelledError received before send_ta…
Browse files Browse the repository at this point in the history
…sk has a chance to run
  • Loading branch information
wemoloh committed Oct 1, 2019
1 parent 7d0f64d commit 8b0d64a
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions eider.py
Original file line number Diff line number Diff line change
Expand Up @@ -1189,6 +1189,8 @@ def receive(self, whither):
send_task.cancel()
try:
yield from send_task
except CancelledError:
pass
except Exception as exc:
self.logger.error('{}: {}'.format(type(exc).__name__, exc),
exc_info=True)
Expand Down Expand Up @@ -1536,19 +1538,16 @@ def send(self, header, body=None):

@coroutine
def send_forever(self):
try:
while 1:
data = yield from self.sendq.get()
self.log_data('send', data)
try:
yield from self.ws_send(data)
except CancelledError:
raise
except Exception as exc:
self.logger.error('{}: {}'.format(type(exc).__name__, exc),
exc_info=True)
except CancelledError:
pass
while 1:
data = yield from self.sendq.get()
self.log_data('send', data)
try:
yield from self.ws_send(data)
except CancelledError:
raise
except Exception as exc:
self.logger.error(
'{}: {}'.format(type(exc).__name__, exc), exc_info=True)

@coroutine
def ws_send_aiohttp(self, data):
Expand Down

0 comments on commit 8b0d64a

Please sign in to comment.