X-Git-Url: http://git.kaliko.me/?p=python-musicpdaio.git;a=blobdiff_plain;f=mpdaio%2Fconnection.py;h=f4a97de09039f3220ce81ea6971ef99155bf5f5d;hp=f327a92f109afbc062d6006a31861e064b3df2d2;hb=98d6037125815600cf4732be859848c1bf7c1eca;hpb=deee9815c5d84fc6740a1cece500526bd43142d4 diff --git a/mpdaio/connection.py b/mpdaio/connection.py index f327a92..f4a97de 100644 --- a/mpdaio/connection.py +++ b/mpdaio/connection.py @@ -51,6 +51,8 @@ class ConnectionPool(base): # find an un-used connection for this host connection = next( (conn for conn in connections if not conn.in_use), None) + #if connection: + # log.debug('reusing %s', connection) if connection is None: # disconnect the least-recently-used un-used connection to make space # for a new connection. There will be at least one. @@ -65,7 +67,7 @@ class ConnectionPool(base): asyncio.open_connection(server, port), timeout ) - log.info('Connected to %s:%s', host[0], host[1]) + #log.debug('Connected to %s:%s', host[0], host[1]) connection = Connection(self, host, reader, writer) await connection._hello() connections.append(connection) @@ -81,6 +83,7 @@ class ConnectionPool(base): """Close all connections""" connections = [c for cs in self._connections.values() for c in cs] self._connections = OrderedDict() + log.info('Closing all connections') for connection in connections: await connection.close()