diff --git a/piker/brokers/core.py b/piker/brokers/core.py index 01a2c9eb..ae58c837 100644 --- a/piker/brokers/core.py +++ b/piker/brokers/core.py @@ -51,7 +51,11 @@ async def wait_for_network(get_quotes, sleep=1): """ while True: try: - return await get_quotes() + with trio.move_on_after(1) as cancel_scope: + return await get_quotes() + if cancel_scope.cancelled_caught: + log.warn("Quote query timed out") + continue except socket.gaierror: log.warn(f"Network is down waiting for reestablishment...") await trio.sleep(sleep)