python - 删除 celery 中的 Task/PeriodicTask

标签 python rabbitmq celery

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

最佳答案

撤销 任务:参见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.

关于python - 删除 celery 中的 Task/PeriodicTask,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2557424/

相关文章:

c - 消息在 RabbitMQ C master 中丢失

python - 实现 ensureIndex() 以使用 pymongo 删除重复文档

activemq - 商业消息中间件与开源的优势

java - RabbitMQ 中服务器端超时是多少?

python-3.x - 如何让 celery worker 停止接收新任务(Kubernetes)

python - 出错时停止重试定期 celery 任务

celery - 为什么Celery让 worker 气馁并一起殴打?

python - 立即检查一组变量的 boolean 值

python - 日期时间值小于 datetime.min 是什么意思?

python - Python 中的单行和多行循环和矢量化