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__/filesystem.cpython-39.pyc
a

��Sh��@szdZddlZddlZddlmZddlmZddlmZddlm	Z	ddl
mZe�d�Z
d	Zd
ZdZGdd
�d
e	�ZdS)z!File-system result store backend.�N)�datetime)�ensure_bytes)�uuid)�KeyValueStoreBackend)�ImproperlyConfiguredFz8You need to configure a path for the file-system backendzHA path for the file-system backend should conform to the file URI schemez�The configured path for the file-system backend does not
work correctly, please make sure that it exists and has
the correct permissions.cs~eZdZdZdeejejef�fdd�	Z	d�fdd�	Z
dd	�Zd
d�Zdd
�Z
dd�Zdd�Zdd�Zdd�Zdd�Z�ZS)�FilesystemBackendasFile-system result backend.

    Arguments:
        url (str):  URL to the directory we should use
        open (Callable): open function to use when opening files
        unlink (Callable): unlink function to use when deleting files
        sep (str): directory separator (to join the directory with the key)
        encoding (str): encoding used on the file-system
    Nc	s�t�j|i|��||_|�|�}tjdkrB|�d�rB|dd�}|�|�|_|�|�|_	||_
||_|�dt
��|��dS)N�nt�/�s.fs-backend-)�super�__init__�url�
_find_path�os�name�
startswith�encode�path�sep�open�unlink�_do_directory_testr)	�selfr
rrr�encoding�args�kwargsr��	__class__��D/usr/local/lib/python3.9/site-packages/celery/backends/filesystem.pyr$s
zFilesystemBackend.__init__rcs(|sin|}t��|i|�d|ji��S)Nr
)r�
__reduce__r
)rrrrrrr 8szFilesystemBackend.__reduce__cCsD|stt��|�d�r"|dd�S|�d�r8|dd�Stt��dS)Nzfile://localhost/�zfile://�)r�
E_NO_PATH_SETr�E_PATH_NON_CONFORMING_SCHEME)rr
rrrr<s

zFilesystemBackend._find_pathcCsLz,|�|d�|�|�dks J�|�|�WntyFtt��Yn0dS)Ns
test value)�set�get�delete�OSErrorr�E_PATH_INVALID�r�keyrrrrEsz$FilesystemBackend._do_directory_testcCs|j�|j|f�S�N)r�joinrr*rrr�	_filenameMszFilesystemBackend._filenamecCsXz@|�|�|�d��}|��Wd�WS1s40YWntyRYn0dS)N�rb)rr.�read�FileNotFoundError)rr+�infilerrrr&Ps
,zFilesystemBackend.getcCsD|�|�|�d��}|�t|��Wd�n1s60YdS)N�wb)rr.�writer)rr+�value�outfilerrrr%WszFilesystemBackend.setccs|D]}|�|�VqdSr,)r&)r�keysr+rrr�mget[szFilesystemBackend.mgetcCs|�|�|��dSr,)rr.r*rrrr'_szFilesystemBackend.deletecCs�|js
dStddd|jjd�}|j��|��}||j}t�|j�D]R}|j	|j
|jfD]<}|�|�rZtj�
|j|�}t�|�j|kr�|�|�qFqZqFdS)zDelete expired meta-data.Ni�r
)�tzinfo)�expiresrZapp�timezone�now�
total_secondsr�listdirrZtask_keyprefixZgroup_keyprefixZchord_keyprefixrr-�stat�st_mtimer)r�epochZnow_tsZ	cutoff_ts�filename�prefixrrrr�cleanupbs
�

zFilesystemBackend.cleanup)rN)�__name__�
__module__�__qualname__�__doc__rrrr�default_encodingrr rrr.r&r%r8r'rD�
__classcell__rrrrrs
�	r)rH�localerrZkombu.utils.encodingrZceleryrZcelery.backends.baserZcelery.exceptionsr�getpreferredencodingrIr#r$r)rrrrr�<module>s
�

Yohohohohohooho | Sanrei Aya