CELERYD_TASK_TIME_LIMIT的最大(上限)值? [英] maximum (cap) value for CELERYD_TASK_TIME_LIMIT?
问题描述
我们正在用django-celery做一些有趣的事情.我们的几个任务需要一些时间,我们希望让他们来做自己的事情.我尝试将CELERYD_TASK_TIME_LIMIT设置为一个较大的值,例如86400(24小时),但是我的任务仍然报告5分钟为TimeLimitExceededed.我阅读文档的次数比我想记住的要多,但是我找不到任何引用CELERYD_TASK_TIME_LIMIT的默认值或最大值的东西.
we're doing some crazy fun stuff with django-celery. A couple of our tasks take a while, and we'd like to let them do their thing. I tried setting CELERYD_TASK_TIME_LIMIT to a big value like 86400 (24 hours) and yet my tasks are still reporting TimeLimitExceeded at 5 minutes. I've read over the docs more times than I'd care to remember, but I cannot find anything referencing either a default value for CELERYD_TASK_TIME_LIMIT or a max value.
对我们来说两个非常有价值的问题:
Two really valuable questions for us:
- CELERYD_TASK_TIME_LIMIT的最大值是多少?(现在看来是5分钟,即300分钟)
- 为什么我不能将CELERYD_TASK_TIME_LIMIT设置为None?(是的,我很确定我了解潜在的僵尸工人的影响)
在settings.py
In settings.py
CELERYD_TASK_TIME_LIMIT = 86400 #24 hours
CELERYD_TASK_SOFT_TIME_LIMIT = 86400
推荐答案
要回答有关默认值的问题... CELERYD_TASK_TIME_LIMIT
和 CELERYD_TASK_SOFT_TIME_LIMIT
的默认值均无
.这些值没有记录在案,并且简单的代码库grep也不会帮助您很多.我记录了应用程序 .conf
的所有值以了解自己:
To answer your question about default values... the defaults for CELERYD_TASK_TIME_LIMIT
and CELERYD_TASK_SOFT_TIME_LIMIT
are both None
. These values are not documented, and a simple grep of the codebase won't help you out much either. I logged all the values of the app's .conf
to find out myself:
>>> import celery
>>> app = celery.Celery()
>>> app.conf
这篇关于CELERYD_TASK_TIME_LIMIT的最大(上限)值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!