We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e59cf6c commit a02edafCopy full SHA for a02edaf
livechat/utils/ws_client.py
@@ -81,9 +81,11 @@ def send(self,
81
if not self.sock or self.sock.send(request_json, opcode) == 0:
82
raise WebSocketConnectionClosedException(
83
'Connection is already closed.')
84
- while not (response := next((item for item in self.messages
85
- if item.get('request_id') == request_id),
86
- None)) and response_timeout > 0:
+ while not (response := next(
+ (item
+ for item in self.messages if item.get('request_id') == request_id
87
+ and item.get('type') == 'response'),
88
+ None)) and response_timeout > 0:
89
sleep(0.2)
90
response_timeout -= 0.2
91
self.logger.info(f'\nRESPONSE:\n{json.dumps(response, indent=4)}')
0 commit comments