From 35a0779f227d50d9f4d0877b069bb0571e42c987 Mon Sep 17 00:00:00 2001 From: Marcel van der Veldt Date: Thu, 4 Aug 2022 00:58:23 +0200 Subject: [PATCH] don't hide timeout errors --- music_assistant/helpers/process.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/music_assistant/helpers/process.py b/music_assistant/helpers/process.py index d88c4ca4..997aafaa 100644 --- a/music_assistant/helpers/process.py +++ b/music_assistant/helpers/process.py @@ -15,7 +15,7 @@ from async_timeout import timeout as _timeout LOGGER = logging.getLogger(__name__) DEFAULT_CHUNKSIZE = 128000 -DEFAULT_TIMEOUT = 120 +DEFAULT_TIMEOUT = 600 # pylint: disable=invalid-name @@ -110,8 +110,6 @@ class AsyncProcess: return await self._proc.stdout.readexactly(n) except asyncio.IncompleteReadError as err: return err.partial - except asyncio.TimeoutError: - return b"" async def read(self, n: int, timeout: int = DEFAULT_TIMEOUT) -> bytes: """ @@ -123,11 +121,8 @@ class AsyncProcess: """ if self.closed: return b"" - try: - async with _timeout(timeout): - return await self._proc.stdout.read(n) - except asyncio.TimeoutError: - return b"" + async with _timeout(timeout): + return await self._proc.stdout.read(n) async def write(self, data: bytes) -> None: """Write data to process stdin.""" -- 2.34.1