删除芹菜中的Task / PeriodicTask

时间:2010-04-01 00:30:08

标签: python rabbitmq celery

如何删除芹菜中的常规Task或PeriodicTask?

1 个答案:

答案 0 :(得分:16)

revoke任务:请参阅documentation

Control.revoke(task_id, destination=None, terminate=False, signal='SIGTERM', **kwargs)
    Tell all (or specific) workers to revoke a task by id.

    If a task is revoked, the workers will ignore the task and not execute it after all.

    Parameters: 
        task_id – Id of the task to revoke.
        terminate – Also terminate the process currently working on the task (if any).
        signal – Name of signal to send to process if terminate. Default is TERM.