|
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__/ |
a
��Sh� � @ sz d Z ddlZddlZddlmZ ddlmZ ddlmZ ddlm Z ddl
mZ e�d�Z
d Zd
ZdZG dd
� 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.c s~ e Zd ZdZdeejejef� fdd� Z d� fdd� Z
dd � Zd
d� Zdd
� Z
dd� Zdd� Zdd� Zdd� Zdd� Z� ZS )�FilesystemBackendas File-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
� �|� � d S )N�nt�/� s .fs-backend-)�super�__init__�url�
_find_path�os�name�
startswith�encode�path�sep�open�unlink�_do_directory_testr ) �selfr
r r r �encoding�args�kwargsr �� __class__� �D/usr/local/lib/python3.9/site-packages/celery/backends/filesystem.pyr $ s
zFilesystemBackend.__init__r c s( |si n|}t � �|i |�d| ji��S )Nr
)r �
__reduce__r
)r r r r r r r 8 s zFilesystemBackend.__reduce__c C sD |st t��|�d�r"|dd � S |�d�r8|dd � S t t��d S )Nzfile://localhost/� zfile://� )r �
E_NO_PATH_SETr �E_PATH_NON_CONFORMING_SCHEME)r r
r r r r <