From 4aa4c6f49d27aa724ec8a120003c20215aa90195 Mon Sep 17 00:00:00 2001 From: Timothy Pogue Date: Fri, 25 Nov 2022 13:08:41 -0700 Subject: [PATCH] change sleep in channel send to 0 --- freqtrade/rpc/api_server/ws/channel.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/freqtrade/rpc/api_server/ws/channel.py b/freqtrade/rpc/api_server/ws/channel.py index a5f3b6216..76e48d889 100644 --- a/freqtrade/rpc/api_server/ws/channel.py +++ b/freqtrade/rpc/api_server/ws/channel.py @@ -104,14 +104,9 @@ class WebSocketChannel: logger.info(f"Connection for {self} timed out, disconnecting") raise - # Without this sleep, messages would send to one channel - # first then another after the first one finished and prevent - # any normal Rest API calls from processing at the same time. - # With the sleep call, it gives control to the event - # loop to schedule other channel send methods, and helps - # throttle how fast we send. - # 0.01 = 100 messages/second max throughput - await asyncio.sleep(0.01) + # Explicitly give control back to event loop as + # websockets.send does not + await asyncio.sleep(0) async def recv(self): """