diff --git a/freqtrade/rpc/api_server/api_ws.py b/freqtrade/rpc/api_server/api_ws.py index 5e2eddc68..ed458165e 100644 --- a/freqtrade/rpc/api_server/api_ws.py +++ b/freqtrade/rpc/api_server/api_ws.py @@ -58,7 +58,7 @@ async def channel_broadcaster(channel: WebSocketChannel, message_stream: Message " consumers." ) - await channel.send(message, timeout=True) + await channel.send(message, use_timeout=True) async def _process_consumer_request(request: Dict[str, Any], channel: WebSocketChannel, rpc: RPC): diff --git a/freqtrade/rpc/api_server/ws/channel.py b/freqtrade/rpc/api_server/ws/channel.py index 0041bb6b2..3c1e0ce2d 100644 --- a/freqtrade/rpc/api_server/ws/channel.py +++ b/freqtrade/rpc/api_server/ws/channel.py @@ -80,7 +80,7 @@ class WebSocketChannel: self._send_high_limit = min(max(self.avg_send_time * 2, 1), 3) async def send( - self, message: Union[WSMessageSchemaType, Dict[str, Any]], timeout: bool = False + self, message: Union[WSMessageSchemaType, Dict[str, Any]], use_timeout: bool = False ): """ Send a message on the wrapped websocket. If the sending @@ -88,7 +88,7 @@ class WebSocketChannel: disconnect the connection. :param message: The message to send - :param timeout: Enforce send high limit, defaults to False + :param use_timeout: Enforce send high limit, defaults to False """ try: _ = time.time() @@ -96,7 +96,8 @@ class WebSocketChannel: # a TimeoutError and bubble up to the # message_endpoint to close the connection await asyncio.wait_for( - self._wrapped_ws.send(message), timeout=self._send_high_limit if timeout else None + self._wrapped_ws.send(message), + timeout=self._send_high_limit if use_timeout else None, ) total_time = time.time() - _ self._send_times.append(total_time)