针对特定服务/版本的Google App引擎的Cron

时间:2018-07-13 12:00:05

标签: python-2.7 google-app-engine cron

我在同一项目中有2个服务。

一个服务名称是BAR 一种服务名称是FOO

我在BAR上有cron,并且有两个环境“ default”和“ staging”

我可以这样设置Cron

- description: "STAGING: BAR"
  url: /en/cron
  schedule: 1 of month 07:00
  target: staging
  retry_parameters:
    min_backoff_seconds: 2.5
    max_doublings: 5

- description: "PROD: BAR"
  url: /en/cron
  schedule: 1 of month 07:00
  target: default
  retry_parameters:
    min_backoff_seconds: 2.5
    max_doublings: 5

即使是FOO,我也想这样做 我有两个环境“ foo”和“ stagingfoo”

- description: "STAGING: FOO"
  url: /en/foo/cron
  schedule: 1 of month 07:00
  target: stagingfoo
  retry_parameters:
    min_backoff_seconds: 2.5
    max_doublings: 5

- description: "PROD: FOO"
  url: /en/foo/cron
  schedule: 1 of month 07:00
  target: foo
  retry_parameters:
    min_backoff_seconds: 2.5
    max_doublings: 5

但是stagingfoo给出了一个错误,也许找不到路线。 我的控制台看不到任何错误

> target: staging works 
> target: default works 
> target: foo works target:
> stagingfoo doesn't work

我在cron.yaml中只有一个FOO root文件

1 个答案:

答案 0 :(得分:2)

您必须像这样指定“ FOO”目标:

- description: "STAGING: FOO"
  url: /en/foo/cron
  schedule: 1 of month 07:00
  target: stagingfoo-dot-foo
  retry_parameters:
    min_backoff_seconds: 2.5
    max_doublings: 5