From c50371a825f40517af243383ce11119aed7582a4 Mon Sep 17 00:00:00 2001 From: marcelveldt Date: Sun, 20 Oct 2019 15:22:24 +0200 Subject: [PATCH] Update http_streamer.py --- music_assistant/http_streamer.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/music_assistant/http_streamer.py b/music_assistant/http_streamer.py index 2300a327..f25325e0 100755 --- a/music_assistant/http_streamer.py +++ b/music_assistant/http_streamer.py @@ -70,12 +70,18 @@ class HTTPStreamer(): try: while not cancelled.is_set(): await asyncio.sleep(0.1) - except (asyncio.CancelledError, asyncio.TimeoutError): - LOGGER.warning("stream interrupted") + except (asyncio.CancelledError): + LOGGER.warning("stream cancelled") cancelled.set() # wait for bg_task to finish await asyncio.gather(bg_task) raise asyncio.CancelledError() + except (asyncio.TimeoutError): + LOGGER.warning("stream time-out") + cancelled.set() + # wait for bg_task to finish + await asyncio.gather(bg_task) + raise asyncio.TimeoutError() return resp async def __stream_single(self, player, queue_item, buffer, cancelled): -- 2.34.1