Change poll_interval=5s, restart_interval=15s
@@ -63,9 +63,9 @@ def match_event(self, listener, event):
class WebSocketListener:
- def __init__(self, plex: PlexServer, interval=1, restart_interval=10):
+ def __init__(self, plex: PlexServer, poll_interval=5, restart_interval=15):
self.plex = plex
- self.interval = interval
+ self.poll_interval = poll_interval
self.restart_interval = restart_interval
self.dispatcher = EventDispatcher()
self.logger = logging.getLogger("PlexTraktSync.WebSocketListener")
@@ -77,7 +77,7 @@ def listen(self):
while True:
notifier = self.plex.startAlertListener(callback=self.dispatcher.event_handler)
while notifier.is_alive():
- sleep(self.interval)
+ sleep(self.poll_interval)
self.dispatcher.event_handler(Error(msg='Server closed connection'))
self.logger.error(f"Listener finished. Restarting in {self.restart_interval} seconds")
