Yohohohohohooho | Sanrei Aya
Sanrei Aya


Server : LiteSpeed
System : Linux barito.iixcp.rumahweb.net 5.14.0-611.49.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Apr 21 16:39:08 EDT 2026 x86_64
User : elvh3918 ( 1528)
PHP Version : 8.2.31
Disable Function : mail
Directory :  /usr/local/lib/python3.9/site-packages/celery/backends/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //usr/local/lib/python3.9/site-packages/celery/backends/__pycache__/cache.cpython-39.pyc
a

��Sh��@s�dZddlmZmZddlmZddlmZddlm	Z	ddl
mZdZd	gZ
d
ZdZe	dd
�Zdd�Zdd�ZGdd�d�Zeeedd�d�ZGdd�de�Zd	S)z-Memcached and in-memory cache result backend.�)�bytes_to_str�ensure_bytes)�cached_property)�ImproperlyConfigured)�LRUCache�)�KeyValueStoreBackend)�CacheBackendNzBThe Memcached backend requires either pylibmc or python-memcached.zYThe cache backend {0!r} is unknown,
Please use one of the following backends instead: {1}i�)�limitcCsxtddurpdt}}zddl}d}Wn:ty`zddl}WntyZtt��Yn0Yn0|||ftd<tdS)NrFT)�_impr�pylibmc�ImportError�memcacher�REQUIRES_BACKEND)�
is_pylibmcZmemcache_key_tr�r�?/usr/local/lib/python3.9/site-packages/celery/backends/cache.py�import_best_memcaches
rcs.t�\}}}|j}�|s&�fdd�}||fS)Ncs|�dd��|i|��S)NZ	behaviors)�pop)�args�kwargs�Z_Clientrr�Client2sz!get_best_memcache.<locals>.Client)rr)rrrr�key_trrrr�get_best_memcache+s

rc@sFeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zddd
�Zdd�Z	dS)�DummyClientcOs
t|_dS�N)�_DUMMY_CLIENT_CACHE�cache)�selfrrrrr�__init__;szDummyClient.__init__cOs|j�|�Sr)r�get�r�keyrrrrrr!>szDummyClient.getcs|j��fdd�|D�S)Ncsi|]}|�vr|�|�qSrr)�.0�k�rrr�
<dictcomp>C�z)DummyClient.get_multi.<locals>.<dictcomp>r&�r�keysrr&r�	get_multiAszDummyClient.get_multicOs||j|<dSrr&)rr#�valuerrrrr�setEszDummyClient.setcOs|j�|d�dSr)rrr"rrr�deleteHszDummyClient.deletercCs|j�||�Sr)r�incr)rr#�deltarrrr/KszDummyClient.incrcCsdSrr)rr#�expirerrr�touchNszDummyClient.touchN)r)
�__name__�
__module__�__qualname__r r!r+r-r.r/r2rrrrr9s
rcCsttfSr)rrrrrr�<lambda>Vr(r6)rZ	memcachedrZmemorycs�eZdZdZdZdZdZdZd�fdd�	Zdd�Z	dd	�Z
d
d�Zdd
�Z�fdd�Z
dd�Zdd�Zedd��Zd�fdd�	Zdd�Z�ZS)r	zCache result backend.NTc	
s�|sin|}t�j|fi|��||_t|jjjfi|��|_|pN|pN|jjj|_	|j	r~|j	�
d�\|_	}}|�d��d�|_
|j|td�|_zt|j	�\|_|_Wn*ty�tt�|j	d�t����Yn0|��dS)N�://�/�;)�typez, )�superr �url�dict�app�confZcache_backend_options�optionsZ
cache_backend�backend�	partition�rstrip�split�serversZprepare_expires�int�expires�backendsrr�KeyErrorr�UNKNOWN_BACKEND�format�joinZ_encode_prefixes)	rr>rGrAr@r<r�_rE��	__class__rrr bs$��zCacheBackend.__init__cCs|j�|�Sr)�clientr!�rr#rrrr!wszCacheBackend.getcCs|j�|�Sr)rPr+r)rrr�mgetzszCacheBackend.mgetcCs|j�|||j�Sr)rPr-rG�rr#r,rrrr-}szCacheBackend.setcCs|j�|�Sr)rPr.rQrrrr.�szCacheBackend.deletecs8|�|d�}|jj|d|jd�t�j||fi|��S)Nr)�time)Zget_key_for_chordrPr-rGr;�_apply_chord_incr)rZheader_result_args�bodyrZ	chord_keyrNrrrU�s��zCacheBackend._apply_chord_incrcCs|j�|�Sr)rPr/rQrrrr/�szCacheBackend.incrcCs|j�||�Sr)rPr2rSrrrr1�szCacheBackend.expirecCs|j|jfi|j��Sr)rrEr@)rrrrrP�szCacheBackend.clientrcsN|sin|}d�|j�}|j�d|�d�}|�||j|jd��t��||�S)Nr9r7r8)rArGr@)rLrErA�updaterGr@r;�
__reduce__)rrrrErArNrrrX�s��zCacheBackend.__reduce__cOsd�|j�}|j�d|�d�S)zcReturn the backend as an URI.

        This properly handles the case of multiple servers.
        r9r7r8)rLrErA)rrrrErrr�as_uri�szCacheBackend.as_uri)NNNN)rN)r3r4r5�__doc__rEZsupports_autoexpireZsupports_native_joinZimplements_incrr r!rRr-r.rUr/r1rrPrXrY�
__classcell__rrrNrr	Zs&�

r	)rZZkombu.utils.encodingrrZkombu.utils.objectsrZcelery.exceptionsrZcelery.utils.functionalr�baser�__all__rrrJrrrrrHr	rrrr�<module>s&
�

Yohohohohohooho | Sanrei Aya