|
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
��Shw � @ st d Z ddlmZ ddlmZ ddlmZ ddlmZ zddl Z W n e
yV dZ Y n0 dZd ZG d
d� de�Z
dS )zCouchDB result store backend.� )�bytes_to_str)�
_parse_url)�ImproperlyConfigured� )�KeyValueStoreBackendN)�CouchBackendzKYou need to install the pycouchdb library to use the CouchDB result backendc sn e Zd ZdZdZdZdZdZdZdZ d� fdd� Z
d d
� Zedd� �Z
d
d� Zdd� Zdd� Zdd� Z� ZS )r z�CouchDB backend.
Raises:
celery.exceptions.ImproperlyConfigured:
if module :pypi:`pycouchdb` is not available.
�default�http� localhosti` Nc s� t � j|i |�� || _td u r(tt��d } } } } }} |rlt|�\}
}}}}} }
| rh| �d�nd } |pt| j| _|p�| j | _ t
|p�| j�| _| p�| j| _|p�| j
| _
|p�| j| _d | _d S )N�/)�super�__init__�url� pycouchdbr �ERR_LIB_MISSINGr �strip�scheme�host�int�port� container�username�password�_connection)�selfr �args�kwargsZuschemeZuhostZuport�unameZupassZ
ucontainer�_�� __class__� �A/usr/local/lib/python3.9/site-packages/celery/backends/couchdb.pyr
$ s zCouchBackend.__init__c C s� | j rF| jrF| j� d| j � d| j� d| j� d| j� � }tj|dd�}n$| j� d| j� d| j� �}t�|�}z|�| j�W S tj j
y� |�| j� Y S 0 dS )zConnect to the CouchDB server.z://�:�@�basic)Z
authmethodN)r r r r r r �ServerZdatabaser �
exceptions�NotFound�create)r Zconn_string�serverr! r! r"