2

当我试图弄清楚 celery 是如何工作的,或者更具体地说是它如何与 Django 一起工作时,我将示例 CELERYBEAT_SCHEDULE 设置添加到我的设置文件中。它将 task.add 添加到我的任务队列中。我已经删除了该设置,但它一直在尝试添加该任务。我每天在哨兵中收到成千上万的错误报告,上面写着:

Received unregistered task of type u'tasks.add'.
The message has been ignored and discarded.

Did you remember to import the module containing this task?
Or maybe you are using relative imports?
More: http://docs.celeryq.org/en/latest/userguide/tasks.html#names

The full contents of the message body was:
{'utc': True, 'chord': None, 'args': [16, 16], 'retries': 0, 'expires': None, 'task': u'tasks.add', 'callbacks': None, 'errbacks': None, 'taskset': None, 'kwargs': {}, 'eta': None, 'id': '6d609a07-fbfa-4d6e-aa21-46e779c159c0'} (198b)

如何让 celetbeat 停止尝试添加此任务?

4

1 回答 1

2

我在这里找到了我的答案Stopping/Purging Periodic Tasks in Django-Celery。我在周期性任务下的 Django Admin 中发现了流氓任务。虽然我已经看了十几次,但我一直在寻找 task.add 而不是“add-ever-30-seconds”。

删除定期任务记录后,我清除了我的 celery 队列:Deleting all pending tasks in celery / rabbitmq

于 2013-04-18T14:21:36.183 回答