Plex - Set a timeout of 10 seconds to connect to the server (#596)
authormicha91 <michael.harbarth@gmx.de>
Wed, 29 Mar 2023 19:36:23 +0000 (21:36 +0200)
committerGitHub <noreply@github.com>
Wed, 29 Mar 2023 19:36:23 +0000 (21:36 +0200)
Set a timeout of 10 seconds to connect to the server. On connect all known addresses of the server are tried out and afterwards the best one (SSL over non SSL and local over remote) is used. The current timeout sometimes takes longer than the MA timeout of 30 seconds for the setup of a provider

music_assistant/server/providers/plex/__init__.py

index eaccf57a50919a957aa3e80851146857f217872c..b50f4ff2f50ee6bce638bb7409722672960ea9f2 100644 (file)
@@ -101,7 +101,7 @@ class PlexProvider(MusicProvider):
 
         def connect():
             plex_account = MyPlexAccount(token=self.config.get_value(CONF_AUTH_TOKEN))
-            return plex_account.resource(self.config.get_value(CONF_SERVER_NAME)).connect(None)
+            return plex_account.resource(self.config.get_value(CONF_SERVER_NAME)).connect(None, 10)
 
         self._plex_server = await self._run_async(connect)
         self._plex_library = await self._run_async(