From: Marcel van der Veldt Date: Wed, 3 Aug 2022 22:58:23 +0000 (+0200) Subject: don't hide timeout errors X-Git-Url: https://git.kitaultman.com/?a=commitdiff_plain;h=35a0779f227d50d9f4d0877b069bb0571e42c987;p=music-assistant-server.git don't hide timeout errors --- 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."""