Handle (far end forced) disconnects

unleash_the_kraken
Tyler Goodlet 2020-08-09 00:01:40 -04:00
parent 03c5c7d2ba
commit 44010abf4d
1 changed files with 2 additions and 1 deletions

View File

@ -9,6 +9,7 @@ import json
import time import time
import trio_websocket import trio_websocket
from trio_websocket._impl import ConnectionClosed, DisconnectionTimeout
import arrow import arrow
import asks import asks
import numpy as np import numpy as np
@ -247,7 +248,7 @@ async def stream_quotes(
}) })
yield asdict(ohlc) yield asdict(ohlc)
ohlc_last = ohlc ohlc_last = ohlc
except trio_websocket._impl.ConnectionClosed: except (ConnectionClosed, DisconnectionTimeout):
log.exception("Good job kraken...reconnecting") log.exception("Good job kraken...reconnecting")