From fec684210cbdcf87fdfc50b21b2a6584e661457c Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Sun, 21 Oct 2018 14:50:58 +0200 Subject: [PATCH] Wrapped MPD plugin reload logic to prevent the backend from crashing if the second initialization fails as well --- platypush/backend/music/mpd/__init__.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/platypush/backend/music/mpd/__init__.py b/platypush/backend/music/mpd/__init__.py index ec9f543b14..14f4261928 100644 --- a/platypush/backend/music/mpd/__init__.py +++ b/platypush/backend/music/mpd/__init__.py @@ -62,7 +62,11 @@ class MusicMpdBackend(Backend): except Exception as e: self.logger.exception(e) self.logger.info('Reloading crashed MPD plugin') - plugin = get_plugin('music.mpd', reload=True) + try: + plugin = get_plugin('music.mpd', reload=True) + except: + pass + time.sleep(self.poll_seconds) if state != last_state: