Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/celery/backends/__pycache__/consul.cpython-39.pyc
Ðазад
a t�h� � @ s� d Z ddlmZ ddlmZ ddlmZ ddlmZ ddl m Z zddlZW n eyb dZY n0 e e �ZdZd ZG d d� de�ZdS )z�Consul result store backend. - :class:`ConsulBackend` implements KeyValueStoreBackend to store results in the key-value store of Consul. � )�bytes_to_str)� parse_url)�KeyValueStoreBackend)�ImproperlyConfigured)� get_loggerN)� ConsulBackendz^You need to install the python-consul library in order to use the Consul result store backend.c sh e Zd ZdZeZdZdZdZ� fdd�Zdd� Z d d � Z dd� Zd d� Zdd� Z dd� Zdd� Z� ZS )r z'Consul.io K/V store backend for Celery.TZ consistentNc sD t � j|i |�� | jd u r$tt��d | _| jf i t| j��� d S �N) �super�__init__�consulr �CONSUL_MISSING� one_client�_init_from_paramsr �url)�self�args�kwargs�� __class__� ��/root/rpmbuild/BUILDROOT/imh-python39-modules-3.9.7-92.el8.x86_64/opt/imh-python/lib/python3.9/site-packages/celery/backends/consul.pyr % s zConsulBackend.__init__c K s: t �d||� || _|| _|| _|�dd �r6| �� | _d S )Nz,Setting on Consul client to connect to %s:%dr )�logger�debug�path�hostname�port�get�clientr )r r r Zvirtual_host�paramsr r r r 3 s �zConsulBackend._init_from_paramsc C s | j ptj| j| j| jd�S )N)�hostr �consistency)r r ZConsulr r r )r r r r r A s �zConsulBackend.clientc C s&