|
Server : Apache System : Linux cvar2.toservers.com 3.10.0-962.3.2.lve1.5.73.el7.x86_64 #1 SMP Wed Aug 24 21:31:23 UTC 2022 x86_64 User : njnconst ( 1116) PHP Version : 8.4.18 Disable Function : NONE Directory : /opt/alt/python37/lib/python3.7/site-packages/beaker/ext/__pycache__/ |
Upload File : |
B
��[� � @ s� d dl mZ d dlZd dlZd dlmZ d dlmZmZ d dlmZm Z d dl
mZmZ d dl
mZmZ e�e�ZdadadaG dd � d e�ZG d
d� de�ZdS )� )�pickleN)�datetime)�OpenResourceNamespaceManager� Container)�InvalidCacheBackendError�MissingCacheParameter)�file_synchronizer�null_synchronizer)�verify_directory�SyncDictc @ s~ e Zd Ze� Ze� Zedd� �Zddd�Zdd � Z d
d� Z
dd
� Zdd� Zdd� Z
dd� Zdd� Zdd� Zdd� Zdd� ZdS )�DatabaseNamespaceManagerc C sR t d k rd S y$dd la dd lma ddlma W n tk
rL td��Y nX d S )Nr )�typesz8Database cache backend requires the 'sqlalchemy' library)�sa�
sqlalchemyZsqlalchemy.pool�poolr
�ImportErrorr )�cls� r �D/opt/alt/python37/lib/python3.7/site-packages/beaker/ext/database.py�_init_dependencies s z+DatabaseNamespaceManager._init_dependenciesNF�beaker_cachec s� t �| |� � dkri � d| _|r*|| _n|r8|d | _| jrHt| j� �pR� d ��� }
� ���fdd�}i | _d| _d| _tj� |
|�| _
dS )aT Creates a database namespace manager
``url``
SQLAlchemy compliant db url
``sa_opts``
A dictionary of SQLAlchemy keyword options to initialize the engine
with.
``optimistic``
Use optimistic session locking, note that this will result in an
additional select when updating a cache value to compare version
numbers.
``table_name``
The table name to use in the database for the cache.
``schema_name``
The schema name to use in the database for the cache.
Nz/container_db_lockzsa.urlc s� �� } � �fdd�}t j�| |�}tj�|tjdtjdd�tjdt�d�dd �tjd
tj dd �tjdtj dd �tjdtj
dd �t�d��r��n|jd
� }|j
dd� |S )Nc s&