推送队列任务有一个非常有用的功能:
If the task returns a status code outside of this range, App Engine retries the task until it succeeds.
但是对于 Cron Task 来说似乎不一样。正如我从日志中看到的,如果 Cron 任务失败并显示 500 状态代码,Appengine 不会尝试重试此任务。
我知道我可以将其配置为标准队列( Configuring_Retry_Attempts_for_Failed_Tasks ),并且想知道我可以为 Cron 任务进行这样的配置吗?就像名为 __cron
的队列的配置?
最佳答案
不,您不能,但您可以从 cron 调用任务队列,然后根据需要配置该任务队列。
我问了类似的问题here与下面的响应,我已经对 GAE cron 进行了足够的实验,以确认它确实具有与任务队列相同的可配置性。
[GAE cron] doesn't use a task queue, and the retry options for cron 'tasks' aren't configurable. The closest you can get is to do nothing in your cron 'task' except enqueue another task, which can be configured via a queue.
关于java - 在 Google Appengine 上重试失败的 Cron 任务,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17992568/