delete Task / PeriodicTask in celery

橙三吉。 提交于 2019-12-22 04:00:39

问题


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


回答1:


You revoke the task: See 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.


来源:https://stackoverflow.com/questions/2557424/delete-task-periodictask-in-celery

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!