gpt4 book ai didi

celery - celery 拍打不正常

转载 作者:行者123 更新时间:2023-12-04 16:45:19 27 4
gpt4 key购买 nike

当我运行此命令进行 celery 节拍时。

[2013-06-27 02:17:05,936: INFO/MainProcess] Celerybeat: Starting...

[2013-06-27 02:17:05,937: INFO/MainProcess] Writing entries...

[2013-06-27 02:17:08,711: INFO/MainProcess] DatabaseScheduler: Schedule changed.

[2013-06-27 02:17:08,712: INFO/MainProcess] Writing entries...



它停留在这个结果上。但是在我的settings.py中,我已经配置了CELERYBEAT_SCHEDULE。
CELERYBEAT_SCHEDULER = "djcelery.schedulers.DatabaseScheduler"

from datetime import timedelta

CELERYBEAT_SCHEDULE = {
'add-every-30-seconds': {
'task': 'celerytest.tasks.add',
'schedule': timedelta(seconds=30),
'args': (16, 16)
},

'add-every-10-seconds': {
'task': 'celerytest.tasks.minus',
'schedule': timedelta(seconds=10),
'args': (20, 16)
},

}

我的 celery 拍子怎么了?

最佳答案

celery beat命令启动celery scheduler。此过程安排任务并将其定期放置在队列中。它不执行任务。

您需要启动celery beat celery worker(我猜您正在使用django-celery):

python manage.py celery beat
python manage.py celery worker

或者简单地:
python manage.py celery worker --beat

关于celery - celery 拍打不正常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17322948/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com