HEX
Server: Apache
System: Linux server2.voipitup.com.au 4.18.0-553.104.1.lve.el8.x86_64 #1 SMP Tue Feb 10 20:07:30 UTC 2026 x86_64
User: posscale (1027)
PHP: 8.2.29
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //opt/saltstack/salt/lib/python3.10/site-packages/salt/modules/__pycache__/celery.cpython-310.pyc
o

�N�gQ
�@s�dZddlZddlmZe�e�ZzddlmZddl	m
Z
dZWney,dZYnwdd	�Z
								
			d
dd�ZdS)a�
Support for scheduling celery tasks. The worker is independent of salt and thus can run in a different
virtualenv or on a different python version, as long as broker, backend and serializer configurations match.
Also note that celery and packages required by the celery broker, e.g. redis must be installed to load
the salt celery execution module.

.. note::
    A new app (and thus new connections) is created for each task execution
�N)�SaltInvocationError)�Celery)�TimeoutErrorTFcCstsdSdS)z.
    Only load if celery libraries exist.
    )Fz?The celery module could not be loaded: celery library not foundT)�
HAS_CELERY�rr�G/opt/saltstack/salt/lib/python3.10/site-packages/salt/modules/celery.py�__virtual__sr��?cCs,|std��t||dd��}|r|j�|�|���Z|pg}|p"i}|j|||d�}
|rmz|
j||||	d�WWd�Wd�Styl}zt�	d�|
rU�WYd}~Wd�Wd�dSd}~wwWd�n1swwYWd�dSWd�dS1s�wYdS)a�
    Execute celery tasks. For celery specific parameters see celery documentation.

    CLI Example:

    .. code-block:: bash

        salt '*' celery.run_task tasks.sleep args=[4] broker=redis://localhost \
        backend=redis://localhost wait_for_result=true

    task_name
        The task name, e.g. tasks.sleep

    args
        Task arguments as a list

    kwargs
        Task keyword arguments

    broker
        Broker for celeryapp, see celery documentation

    backend
        Result backend for celeryapp, see celery documentation

    wait_for_result
        Wait until task result is read from result backend and return result, Default: False

    timeout
        Timeout waiting for result from celery, see celery AsyncResult.get documentation

    propagate
        Propagate exceptions from celery task, see celery AsyncResult.get documentation, Default: True

    interval
        Interval to check for task result, see celery AsyncResult.get documentation, Default: 0.5

    no_ack
        see celery AsyncResult.get documentation. Default: True

    raise_timeout
        Raise timeout exception if waiting for task result times out. Default: False

    config
        Config dict for celery app, See celery documentation

    zbroker parameter is requiredF)�broker�backendZset_as_current)�args�kwargs)�timeout�	propagate�interval�no_ackNz<Waiting for the result of a celery task execution timed out.)
rrZconf�update�
connectionZ	send_task�getr�log�error)Z	task_namerr
r
rZwait_for_resultrrrrZ
raise_timeoutZconfigZappZasync_result�exrrr�run_task$sF=
����
������"�r)NNNNFNTr	TTN)�__doc__�loggingZsalt.exceptionsr�	getLogger�__name__rZceleryrZcelery.exceptionsrr�ImportErrorrrrrrr�<module>s0

��