[英]Celery won't resume execution of a task at given ETA
I am running a Celery 4.0.2 app on Python 3.6. 我正在Python 3.6上运行Celery 4.0.2应用程序。 I produce a task like this: 我产生这样的任务:
eta = datetime.datetime.now() + datetime.timedelta(minutes=15)
task.apply_async(args=args, eta=eta)
The message is unacked in my broker (RabbitMQ) so basically application must have taken it. 该消息在我的代理(RabbitMQ)中没有被确认,因此基本上应用程序必须已接收它。 Logs from application confirm it: 来自应用程序的日志确认:
11:05:04 PM worker.1 | [2017-07-02 23:05:04,029: INFO/MainProcess] Received task: myapp.task[880af074-0bf1-4aa2-a4d0-33dd54cd97b9] ETA:[2017-07-02 23:18:10+00:00]
Yet 23:18:10 passed and... nothing happened. 然而23:18:10过去了...没有任何反应。 Task stays unacked, application is not processing it. 任务未得到确认,应用程序未对其进行处理。 Why? 为什么? and how to fix it? 以及如何解决?
It seems that Celery (by default) is calculating times relative to datetime.utcnow()
, not datetime.now()
. 似乎Celery(默认情况下)正在计算相对于datetime.utcnow()
,而不是datetime.now()
。 Try changing that and see if it fixes the problem. 尝试更改它,看看是否可以解决问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.