Cron per Service/Module (AppEngine)

后端 未结 2 1940
-上瘾入骨i
-上瘾入骨i 2020-12-21 13:38

I have two modules/services and each one has a cron.xml. Only one of these ever seems to run (the most recently deployed in my experience), and the other doesn\'t fail, but

2条回答
  •  醉梦人生
    2020-12-21 14:10

    The cron.yaml is an app-level config file, not a service/module one. Meaning when you deploy the one you have in one module it'll overwrite the cron config from the other one.

    So you have to create a single cron.yaml file containing job configs for all services/modules. As @GAEfan mentioned you'll also need add target configs for each job. You might also need to add a dispatch.yaml file and maybe re-visit/adjust the request paths so that the cron job-issued requests make it to the right service/module.

    Deploying the app-level cron.yaml might not be happening implicitly when deploying the service(s), you may need to deploy it explicitly. From Uploading cron jobs:

    Option 2: Upload only your cron updates

    To update just the cron configuration without uploading the rest of the application, run the following command:

    appcfg.py update_cron 
    

    Some more or less related Q&As:

    • Deploying different languages services to the same Application [Google App Engine]
    • Can a default service/module in a Google App Engine app be a sibling of a non-default one in terms of folder structure?

提交回复
热议问题