Restart websocket if connection was closed
@@ -29,6 +29,10 @@ def handler(data):
for handler in self.event_handlers[event_type]:
handler(data)
+ while True:
notifier = self.plex.startAlertListener(callback=handler)
while notifier.is_alive():
sleep(self.interval)
+
+ self.logger.debug(f"Listener finished. Restarting in {self.interval}")
+ sleep(self.interval)
