]> kaliko git repositories - python-musicpdaio.git/commitdiff
Fixed mpd_timeout from env var
authorkaliko <kaliko@azylum.org>
Sun, 10 Mar 2024 16:03:46 +0000 (17:03 +0100)
committerkaliko <kaliko@azylum.org>
Sun, 10 Mar 2024 16:03:46 +0000 (17:03 +0100)
mpdaio/client.py

index c37e0d6cc3946cb573104b23863519227c8d1a50..00dbfed61f50e237bac788000200236b4752af3e 100644 (file)
@@ -41,6 +41,8 @@ class MPDClient:
             password: str | None = None):
         #: Connection pool
         self._pool = ConnectionPool(max_connections=CONNECTION_MAX)
+        #: connection timeout
+        self.mpd_timeout = CONNECTION_TIMEOUT
         self._get_envvars()
         #: Host used to make connections (:py:obj:`str`)
         self.host = host or self.server_discovery[0]
@@ -48,8 +50,6 @@ class MPDClient:
         self.pwd = password or self.server_discovery[2]
         #: port used with the current connection (:py:obj:`int`, :py:obj:`str`)
         self.port = port or self.server_discovery[1]
-        #: connection timeout
-        self.mpd_timeout = CONNECTION_TIMEOUT
         log.info('Using %s:%s to connect', self.host, self.port)
 
     def _get_envvars(self):