From 58518a4d6372d6b1dbeb6425dd4a0d8fab22d68b Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Thu, 4 Apr 2024 00:51:39 +0200 Subject: [PATCH] Better timeout management on mopidy status refresh. --- platypush/plugins/music/mopidy/_client.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/platypush/plugins/music/mopidy/_client.py b/platypush/plugins/music/mopidy/_client.py index d27129ed13..580e5f333e 100644 --- a/platypush/plugins/music/mopidy/_client.py +++ b/platypush/plugins/music/mopidy/_client.py @@ -150,6 +150,12 @@ class MopidyClient(Thread): if self._refresh_in_progress.is_set(): return + # Unless we are also retrieving the tracks, we don't need a high timeout here. + # A high timeout may result in event lagging if some of the responses aren't received. + # In this case, better to timeout early and retry. + if not with_tracks: + timeout = 5 + events = [] try: