mirror of
https://github.com/morpheus65535/bazarr.git
synced 2025-01-07 15:27:38 +08:00
Fixed the movies not getting synced after a reconnection of Radarr SignalR feed.
This commit is contained in:
parent
5f99836801
commit
1fdad498f6
1 changed files with 7 additions and 4 deletions
|
@ -83,8 +83,6 @@ class RadarrSignalrClient:
|
||||||
self.configure()
|
self.configure()
|
||||||
logging.debug('BAZARR connecting to Radarr SignalR feed...')
|
logging.debug('BAZARR connecting to Radarr SignalR feed...')
|
||||||
self.connection.start()
|
self.connection.start()
|
||||||
if not args.dev:
|
|
||||||
scheduler.execute_job_now('update_movies')
|
|
||||||
|
|
||||||
def stop(self):
|
def stop(self):
|
||||||
logging.info('BAZARR SignalR client for Radarr is now disconnected.')
|
logging.info('BAZARR SignalR client for Radarr is now disconnected.')
|
||||||
|
@ -100,6 +98,12 @@ class RadarrSignalrClient:
|
||||||
logging.error("BAZARR connection to Radarr SignalR feed has failed. We'll try to reconnect.")
|
logging.error("BAZARR connection to Radarr SignalR feed has failed. We'll try to reconnect.")
|
||||||
self.restart()
|
self.restart()
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def on_connect_handler():
|
||||||
|
logging.info('BAZARR SignalR client for Radarr is connected and waiting for events.')
|
||||||
|
if not args.dev:
|
||||||
|
scheduler.execute_job_now('update_movies')
|
||||||
|
|
||||||
def configure(self):
|
def configure(self):
|
||||||
self.apikey_radarr = settings.radarr.apikey
|
self.apikey_radarr = settings.radarr.apikey
|
||||||
self.connection = HubConnectionBuilder() \
|
self.connection = HubConnectionBuilder() \
|
||||||
|
@ -113,8 +117,7 @@ class RadarrSignalrClient:
|
||||||
"reconnect_interval": 5,
|
"reconnect_interval": 5,
|
||||||
"max_attempts": None
|
"max_attempts": None
|
||||||
}).build()
|
}).build()
|
||||||
self.connection.on_open(lambda: logging.info('BAZARR SignalR client for Radarr is connected and waiting for '
|
self.connection.on_open(self.on_connect_handler)
|
||||||
'events.'))
|
|
||||||
self.connection.on_reconnect(lambda: logging.info('BAZARR SignalR client for Radarr connection as been lost. '
|
self.connection.on_reconnect(lambda: logging.info('BAZARR SignalR client for Radarr connection as been lost. '
|
||||||
'Trying to reconnect...'))
|
'Trying to reconnect...'))
|
||||||
self.connection.on_close(lambda: logging.debug('BAZARR SignalR client for Radarr is disconnected.'))
|
self.connection.on_close(lambda: logging.debug('BAZARR SignalR client for Radarr is disconnected.'))
|
||||||
|
|
Loading…
Reference in a new issue