From 724f625963ff1cc4b0eee4d1a2f27e428ce5b8f8 Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Sun, 12 Nov 2023 15:52:31 +0100 Subject: [PATCH] [`media.chromecast`] Skip errors on `cast.wait`. It may be that the cast thread has been recycled and it's already been awaited. It's safe to skip the error in these cases. --- platypush/plugins/media/chromecast/__init__.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/platypush/plugins/media/chromecast/__init__.py b/platypush/plugins/media/chromecast/__init__.py index eea4e716..5c900760 100644 --- a/platypush/plugins/media/chromecast/__init__.py +++ b/platypush/plugins/media/chromecast/__init__.py @@ -165,7 +165,12 @@ class MediaChromecastPlugin(MediaPlugin, RunnablePlugin): raise RuntimeError(f'Device {chromecast} not found') cast = self.chromecasts[chromecast] - cast.wait() + + try: + cast.wait() + except Exception as e: + self.logger.warning('Failed to wait Chromecast sync: %s', e) + return cast @action