pythoncelerycelery-taskceleryd

how to remove task from celery with redis broker?


I Have add some wrong task to a celery with redis broker

but now I want to remove the incorrect task and I can't find any way to do this

Is there some commands or some api to do this ?


Solution

  • I know two ways of doing so:

    1) Delete queue directly from broker. In your case it's Redis. There are two commands that could help you: llen (to find right queue) and del (to delete it).

    2) Start celery worker with --purge or --discard options. Here is help:

    --purge, --discard    Purges all waiting tasks before the daemon is started.
                          **WARNING**: This is unrecoverable, and the tasks will
                          be deleted from the messaging server.