From df3c1261464f8f72063f019ea865759c74b5a18b Mon Sep 17 00:00:00 2001 From: Timothy Pogue Date: Thu, 8 Sep 2022 10:34:37 -0600 Subject: [PATCH] fix mypy error --- freqtrade/rpc/api_server/api_ws.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/freqtrade/rpc/api_server/api_ws.py b/freqtrade/rpc/api_server/api_ws.py index 64c1cebb5..8a3fcfba2 100644 --- a/freqtrade/rpc/api_server/api_ws.py +++ b/freqtrade/rpc/api_server/api_ws.py @@ -9,7 +9,8 @@ from freqtrade.enums import RPCMessageType, RPCRequestType from freqtrade.rpc.api_server.deps import get_channel_manager, get_rpc from freqtrade.rpc.api_server.ws.channel import WebSocketChannel from freqtrade.rpc.api_server.ws.schema import (ValidationError, WSAnalyzedDFMessage, - WSRequestSchema, WSWhitelistMessage) + WSMessageSchema, WSRequestSchema, + WSWhitelistMessage) from freqtrade.rpc.rpc import RPC @@ -47,6 +48,7 @@ async def _process_consumer_request( return type, data = websocket_request.type, websocket_request.data + response: WSMessageSchema logger.debug(f"Request of type {type} from {channel}") @@ -61,6 +63,7 @@ async def _process_consumer_request( channel.set_subscriptions(data) # We don't send a response for subscriptions + return elif type == RPCRequestType.WHITELIST: # Get whitelist @@ -70,6 +73,7 @@ async def _process_consumer_request( response = WSWhitelistMessage(data=whitelist) # Send it back await channel.send(response.dict(exclude_none=True)) + return elif type == RPCRequestType.ANALYZED_DF: limit = None @@ -86,6 +90,8 @@ async def _process_consumer_request( response = WSAnalyzedDFMessage(data=message) await channel.send(response.dict(exclude_none=True)) + return + @router.websocket("/message/ws") async def message_endpoint(