删除 celery 中的 Task/PeriodicTask [英] delete Task / PeriodicTask in celery

查看:40
本文介绍了删除 celery 中的 Task/PeriodicTask的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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

推荐答案

撤销任务:参见文档:

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.

这篇关于删除 celery 中的 Task/PeriodicTask的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆