o
    ›¨Êh<  ã                   @   sî   d Z ddlZddlmZ ddlmZmZmZ ddlm	Z	 ej
ed�e d¡e d¡ejd	d
eeddd�ejddeeddd�ejddedddd�ejddeddd�ejddeddd�ejddedddd�ejed d!„ ƒƒƒƒƒƒƒƒƒƒƒZdS )"zAThe ``celery migrate`` command, used to filter and move messages.é    N)Ú
Connection)ÚCeleryCommandÚCeleryOptionÚhandle_preload_options)Úmigrate_tasks)ÚclsÚsourceÚdestinationz-nz--limitzMigration OptionszNumber of tasks to consume.)r   ÚtypeÚ
help_groupÚhelpz-tz	--timeoutz%Timeout in seconds waiting for tasks.z-az--ack-messagesTz Ack messages from source broker.)r   Úis_flagr   r   z-Tz--tasksz List of task names to filter on.)r   r   r   z-Qz--queueszList of queues to migrate.z-Fz	--foreverz'Continually migrate tasks until killed.c                    s.   ‡ fdd„}t t|ƒt|ƒfd|i|¤Ž dS )z©Migrate tasks from one broker to another.

    Warning:

        This command is experimental, make sure you have a backup of
        the tasks before you continue.
    c                    s&   ˆ j  d| j› d| j› d|› �¡ d S )NzMigrating task ú/z: )ÚobjÚechoÚcountÚstrtotal)ÚstateÚbodyÚmessage©Úctx© úD/var/www/html/env/lib/python3.10/site-packages/celery/bin/migrate.pyÚon_migrate_task9   s   &z migrate.<locals>.on_migrate_taskÚcallbackN)r   r   )r   r   r	   Úkwargsr   r   r   r   Úmigrate	   s   0ÿþ
ýr   )Ú__doc__ÚclickÚkombur   Úcelery.bin.baser   r   r   Úcelery.contrib.migrater   ÚcommandÚargumentÚoptionÚintÚfloatÚpass_contextr   r   r   r   r   Ú<module>   sf    
ûûûüüû"