o
    Df<                     @   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 )zMigrate 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 K/home/ubuntu/webapp/venv/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    
"