From: Marcel van der Veldt Date: Thu, 11 Apr 2024 13:42:45 +0000 (+0200) Subject: fix another race condition X-Git-Url: https://git.kitaultman.com/?a=commitdiff_plain;h=e11a2671372d2bcc1d0be117a5a34fc6cf3812cf;p=music-assistant-server.git fix another race condition --- diff --git a/music_assistant/server/helpers/audio.py b/music_assistant/server/helpers/audio.py index 8e70a5f2..3e742d66 100644 --- a/music_assistant/server/helpers/audio.py +++ b/music_assistant/server/helpers/audio.py @@ -119,8 +119,9 @@ class FFMpeg(AsyncProcess): await self._stdin_task # make sure the stdin generator is also properly closed # by propagating a cancellederror within - task = asyncio.create_task(self.audio_input.__anext__()) - task.cancel() + with suppress(RuntimeError): + task = asyncio.create_task(self.audio_input.__anext__()) + task.cancel() if not self.collect_log_history: await super().close(send_signal) return