3

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 the endpoint is never triggered (never shows up in the logs).

Is there a 1-cron per project limit? What is the best way to manage crons so that modules aren't cross-dependant?

Jim Keener
  • 9,255
  • 4
  • 24
  • 24

2 Answers2

4

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 <app-directory>

Some more or less related Q&As:

Community
  • 1
  • 1
Dan Cornilescu
  • 39,470
  • 12
  • 57
  • 97
1

Use the target: backend-module-name parameter inside a cron job you want to send to a module other than default. Only one cron.yaml needed.

Make sure you update: appcfg.py update app.yaml backend_module.yaml cron.yaml

GAEfan
  • 11,244
  • 2
  • 17
  • 33