How do I permanently remove a celery task from rabbitMQ?

后端 未结 2 1704
悲哀的现实
悲哀的现实 2021-01-13 00:05

I have around 10,000 scheduled tasks on my current celery setup. I didn\'t realize what scheduled tasks were and decided to use them to send follow-up emails months in advan

2条回答
  •  礼貌的吻别
    2021-01-13 00:46

    1. To properly purge the queue of waiting tasks you have MUST to stop all the workers (http://celery.readthedocs.io/en/latest/faq.html#i-ve-purged-messages-but-there-are-still-messages-left-in-the-queue):

    $ sudo rabbitmqctl stop
    

    or (in case RabbitMQ/message broker is managed by Supervisor):

    $ sudo supervisorctl stop all
    

    2. ...and then purge the tasks from a specific queue:

    $ cd 
    $ celery amqp queue.purge 
    

    3. Start RabbitMQ:

    $ sudo rabbitmqctl start
    

    or (in case RabbitMQ is managed by Supervisor):

    $ sudo supervisorctl start all
    

提交回复
热议问题