
    h<                     *   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       ej                  d       ej                  d       ej                  d	d
eedd       ej                  ddeedd       ej                  ddeddd       ej                  ddedd       ej                  ddedd       ej                  ddeddd      ej                  ed                                                                               Zy)!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                 R      fd}t        t        |      t        |      fd|i| y)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                 v    j                   j                  d| j                   d| j                   d|        y )NzMigrating task /z: )objechocountstrtotal)statebodymessagectxs      N/var/www/Befach/backend/env/lib/python3.12/site-packages/celery/bin/migrate.pyon_migrate_taskz migrate.<locals>.on_migrate_task9   s/    u{{m1U^^4DBtfMN    callbackN)r   r   )r   r	   r
   kwargsr   s   `    r   migrater   	   s5    `O *V$[)* r   )__doc__clickkombur   celery.bin.baser   r   r   celery.contrib.migrater   commandargumentoptionintfloatpass_contextr    r   r   <module>r,      sQ   G   O O 0 =!d,02 d,:< d,57 d,5	7
 d,/	1
 d,<>   >177<2   "Nr   