|
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
��Sh1 � @ s� d Z ddlmZ ddlmZ ddlmZ ddlmZ ddl m
Z
zddlmZ
dd lmZ W n eyv d
Z
ZY n0 dZG dd
� d
e
�Zd
S )zArangoDb result store backend.� )� timedelta)�cached_property)�
_parse_url)�ImproperlyConfigured� )�KeyValueStoreBackend)�
connection)�
AQLQueryErrorN)�ArangoDbBackendc s� e Zd ZdZdZdZdZdZdZdZ dZ
dZeZ
d� fdd � Zed
d� �Zedd
� �Zedd� �Zdd� Zdd� Zdd� Zdd� Zdd� Z� ZS )r
a� ArangoDb backend.
Sample url
"arangodb://username:password@host:port/database/collection"
*arangodb_backend_settings* is where the settings are present
(in the app.conf)
Settings should contain the host, port, username, password, database name,
collection name else the default will be chosen.
Default database name and collection name is celery.
Raises
------
celery.exceptions.ImproperlyConfigured:
if module :pypi:`pyArango` is not available.
z 127.0.0.1Z8529ZceleryN�httpFc sv t � j|i |�� tdu r"td��|| _|du rJd } } } } }} n6t|�\}
}}}} }}|du rrd }}n|�d�\}}| jj� dd�}
|
dur�t
|
t�s�td��ni }
|p�|
� d| j�| _t
|p�|
� d| j��| _|
� d| j�| _|
� d | j�| _|�p|
� d
| j�| _|�p$|
� d| j�| _|�p:|
� d| j�| _| �pP|
� d
| j�| _dj| j| j| jd�| _d| _dS )z8Parse the url or load the settings from settings object.NzEYou need to install the pyArango library to use the ArangoDb backend.�/Zarangodb_backend_settingsz5ArangoDb backend settings should be grouped in a dict�host�port�
http_protocol�verify�database�
collection�username�passwordz{http_protocol}://{host}:{port})r r
r )�super�__init__�py_arango_connectionr �urlr �split�app�conf�get�
isinstance�dictr
�intr r r r r r r �format�arangodb_url�_connection)�selfr �args�kwargsr
r r r r r Z_schemaZdatabase_collectionZ_query�config�� __class__� �B/usr/local/lib/python3.9/site-packages/celery/backends/arangodb.pyr 6 sF ��
���zArangoDbBackend.__init__c C s, | j du r&tj| j| j| j| jd�| _ | j S )zConnect to the arangodb server.N)Z arangoURLr r r )r"