5

我想从 App Engine Cron 作业迁移到 Cloud Scheduler,但在 Cloud Scheduler 中,请求截止时间超时为 60 秒,而不是来自 Cron 作业的请求的 10 分钟。

有没有办法将 Cloud Scheduler App Engine 请求配置为 10 分钟的最后期限超时?

4

3 回答 3

5

这会将作业的最后期限设置为 30 分钟。这是 HTTP 目标的最大值。

gcloud beta scheduler jobs update http <job> --attempt-deadline=1800s --project <project>

此期限允许的持续时间是:对于 HTTP 目标,介于 15 秒和 30 分钟之间。对于 App Engine HTTP 目标,介于 15 秒和 24 小时之间。以秒为单位的持续时间,最多九个小数位,以“s”结尾。示例:“3.5 秒”。

来源:https ://cloud.google.com/scheduler/docs/reference/rest/v1/projects.locations.jobs#Job

于 2021-02-21T03:18:58.373 回答
4

根据他们的 scheduler.v1beta1,可以使用attemptDeadline.

工作尝试的最后期限。如果请求处理程序在此截止日期前未响应,则取消请求并将尝试标记为 DEADLINE_EXCEEDED 失败。失败的尝试可以在执行日志中查看。Cloud Scheduler 会根据 RetryConfig 重试作业。

此截止日期允许的持续时间是:

对于 HTTP 目标,介于 15 秒和 30 分钟之间。对于 App Engine HTTP 目标,介于 15 秒和 24 小时之间。对于 PubSub 目标,此字段将被忽略。

https://cloud.google.com/nodejs/docs/reference/scheduler/0.3.x/google.cloud.scheduler.v1beta1#.Job

于 2019-06-28T22:05:10.443 回答
2

When we look at Cloud Scheduler, we see that when the time is reached to fire a job the request to fire that job may fail. At this point, the request will be retried based on the configuration of that job ... see:

https://cloud.google.com/sdk/gcloud/reference/beta/scheduler/jobs/create/http

Among these settings we find:

  • --max-backoff
  • --max-doublings
  • --max-retry-attempts
  • --max-retry-duration
  • --min-backoff

It seems that if we want to keep trying for a solid 10 minutes we might be able to specify:

  • --max-backoff: 0s
  • --max-doublings: 0
  • --max-retry-attempts: 0
  • --max-retry-duration: 10m
  • --min-backoff: 0s
于 2019-04-26T20:51:52.437 回答