From 0e4095c947cc487661ff6e5560199829d429857e Mon Sep 17 00:00:00 2001 From: jaredgoldman Date: Sun, 16 Apr 2023 10:45:05 -0400 Subject: [PATCH] Don't yield ws from the ping task --- piker/brokers/kucoin.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/piker/brokers/kucoin.py b/piker/brokers/kucoin.py index 4997a06a..020c9e1c 100644 --- a/piker/brokers/kucoin.py +++ b/piker/brokers/kucoin.py @@ -462,7 +462,7 @@ async def open_ping_task(ws: wsproto.WSConnection, ping_interval, connect_id): log.info(f'Starting ping task for kucoin ws connection') n.start_soon(ping_server) - yield ws + yield n.cancel_scope.cancel() @@ -490,7 +490,7 @@ async def stream_quotes( open_autorecon_ws( f'wss://ws-api-spot.kucoin.com/?token={token}&[connectId={connect_id}]' ) as ws, - open_ping_task(ws, ping_interval, connect_id) as ws, + open_ping_task(ws, ping_interval, connect_id), ): log.info('Starting up quote stream') # loop through symbols and sub to feedz