From a1e2730aa1239a3cbb55ee6418f8979adb392991 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Sun, 9 Aug 2020 00:01:40 -0400 Subject: [PATCH] Handle (far end forced) disconnects --- piker/brokers/kraken.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/piker/brokers/kraken.py b/piker/brokers/kraken.py index dd048d45..605c5177 100644 --- a/piker/brokers/kraken.py +++ b/piker/brokers/kraken.py @@ -9,6 +9,7 @@ import json import time import trio_websocket +from trio_websocket._impl import ConnectionClosed, DisconnectionTimeout import arrow import asks import numpy as np @@ -247,7 +248,7 @@ async def stream_quotes( }) yield asdict(ohlc) ohlc_last = ohlc - except trio_websocket._impl.ConnectionClosed: + except (ConnectionClosed, DisconnectionTimeout): log.exception("Good job kraken...reconnecting")