Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 ?

like image 872
timger Avatar asked Jun 19 '13 06:06

timger


People also ask

Why is Celery Redis broker?

A common message broker that is used with celery is Redis which is a performant, in memory, key-value data store. Specifically, Redis is used to store messages produced by the application code describing the work to be done in the Celery task queue.

How many tasks can Celery Redis handle?

Save this answer. Show activity on this post. celery beats only trigger those 1000 tasks (by the crontab schedule), not run them. If you want to run 1000 tasks in parallel, you should have enough celery workers available to run those tasks.

How do I reset my Celery worker?

You can write a Django management command to restart the Celery workers and then hook that command into Django's autoreload utility. Now if you run the Django custom command, the worker should restart automatically when the Django autoreload utility is triggered on changes to the codebase.


1 Answers

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.
like image 176
Artem Mezhenin Avatar answered Sep 28 '22 02:09

Artem Mezhenin