Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

delete Task / PeriodicTask in celery

How can I delete a regular Task or PeriodicTask in celery?

like image 462
user140736 Avatar asked Apr 01 '10 00:04

user140736


1 Answers

You revoke the task: See 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.
like image 89
rlotun Avatar answered Nov 09 '22 13:11

rlotun