From: micha91 Date: Wed, 29 Mar 2023 19:36:23 +0000 (+0200) Subject: Plex - Set a timeout of 10 seconds to connect to the server (#596) X-Git-Url: https://git.kitaultman.com/?a=commitdiff_plain;h=43dd9fa7612628ca86a5bd763ff6995e22f68825;p=music-assistant-server.git Plex - Set a timeout of 10 seconds to connect to the server (#596) 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 --- diff --git a/music_assistant/server/providers/plex/__init__.py b/music_assistant/server/providers/plex/__init__.py index eaccf57a..b50f4ff2 100644 --- a/music_assistant/server/providers/plex/__init__.py +++ b/music_assistant/server/providers/plex/__init__.py @@ -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(