From c7fff1213c46594694350f5a1d61401579b73763 Mon Sep 17 00:00:00 2001 From: Matthias Date: Mon, 17 Oct 2022 20:43:32 +0200 Subject: [PATCH] Rate-limit EMC startup to avoid overwelming the queue --- freqtrade/rpc/api_server/api_ws.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/freqtrade/rpc/api_server/api_ws.py b/freqtrade/rpc/api_server/api_ws.py index 46909955d..2f490b8a8 100644 --- a/freqtrade/rpc/api_server/api_ws.py +++ b/freqtrade/rpc/api_server/api_ws.py @@ -1,3 +1,4 @@ +import asyncio import logging from typing import Any, Dict @@ -89,6 +90,8 @@ async def _process_consumer_request( for _, message in analyzed_df.items(): response = WSAnalyzedDFMessage(data=message) await channel.send(response.dict(exclude_none=True)) + # Throttle the messages to 50/s + await asyncio.sleep(0.02) @router.websocket("/message/ws")