Skip to content

Commit

Permalink
Note if WebSocket was terminated when logging messages sent out
Browse files Browse the repository at this point in the history
We are seeing cases where WS messages are received and
`h.streamer.websocket.WebSocket.send_json` is called, but the reply is never
received on the client. Log whether the connection was terminated, to rule that
out as the reason.
  • Loading branch information
robertknight committed Sep 21, 2023
1 parent 08c3af2 commit d51297d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion h/streamer/websocket.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def closed(self, code, reason=None):

def send_json(self, payload):
if self.debug:
log.info("Sending message %s", payload)
log.info("Sending message %s (terminated: %s)", payload, self.terminated)
if not self.terminated:
self.send(json.dumps(payload))

Expand Down

0 comments on commit d51297d

Please sign in to comment.