c\gdZddlZddlmZGddejZGddZGdd eZGd d eZdS) z`Connection pooling for psycopg2 This module implements thread-safe (and not) connection pools. N) extensionsceZdZdS) PoolErrorN)__name__ __module__ __qualname__Y/var/lib/jenkins/jobs/Dev/workspace/my-venv/lib/python3.11/site-packages/psycopg2/pool.pyrr sDr rc<eZdZdZdZd dZdZd dZd dZd Z dS) AbstractConnectionPoolzGeneric key-based pooling code.ct||_t||_d|_||_||_g|_i|_i|_d|_ t|jD]}| dS)zInitialize the connection pool. New 'minconn' connections are created immediately calling 'connfunc' with given parameters. The connection pool will support a maximum of about 'maxconn' connections. FrN) intminconnmaxconnclosed_args_kwargs_pool_used_rused_keysrange_connect)selfrrargskwargsis r __init__zAbstractConnectionPool.__init__'s7|| 7||        t|$$  A MMOOOO  r Nctj|ji|j}|"||j|<||jt |<n|j||S)z;Create a new connection and assign it to 'key' if not None.) psycopg2connectrrrridrappendrkeyconns r rzAbstractConnectionPool._connect=s[rUs6''''''        llllllll^000001000 ! ! ! ! !3 ! ! ! ! !r