`binance`: same thing, only unsub when connected

misc_brokerd_backend_repairs
Tyler Goodlet 2023-01-19 10:35:39 -05:00
parent b89fd9652c
commit afc45a8e16
1 changed files with 8 additions and 7 deletions

View File

@ -519,14 +519,15 @@ async def stream_quotes(
subs.append("{sym}@bookTicker")
# unsub from all pairs on teardown
await ws.send_msg({
"method": "UNSUBSCRIBE",
"params": subs,
"id": uid,
})
if ws.connected():
await ws.send_msg({
"method": "UNSUBSCRIBE",
"params": subs,
"id": uid,
})
# XXX: do we need to ack the unsub?
# await ws.recv_msg()
# XXX: do we need to ack the unsub?
# await ws.recv_msg()
async with open_autorecon_ws(
'wss://stream.binance.com/ws',