From: marcelveldt Date: Sun, 20 Oct 2019 13:22:24 +0000 (+0200) Subject: Update http_streamer.py X-Git-Url: https://git.kitaultman.com/?a=commitdiff_plain;h=c50371a825f40517af243383ce11119aed7582a4;p=music-assistant-server.git Update http_streamer.py --- 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):