Wrapped MPD plugin reload logic to prevent the backend from crashing if the second initialization fails as well

This commit is contained in:
Fabio Manganiello 2018-10-21 14:50:58 +02:00
parent ae7cd120d2
commit fec684210c
1 changed files with 5 additions and 1 deletions

View File

@ -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: