I have an app.yaml
as below:
application: myapp
module: mymodule
version: 1
runtime: python27
api_version: 1
threadsafe: true
...
The app also has a cron.yaml
as below:
cron:
- description: increase a value every hour
url: /test/inc
schedule: every 60 minutes synchronized
How do I make my cron job target mymodule
instead of the default
module?
In newer versions of GAE (tested at least with 1.8.6), you can just set the target for your cron task:
cron:
- description: increase a value every hour
url: /test/inc
schedule: every 60 minutes synchronized
target: mymodule
Thanks to @voscausa you can use a dispatch.yaml
file https://developers.google.com/appengine/docs/python/modules/routing to route a cron job to the right module.
Make sure you run appcfg.py update_dispatch
after you create the dispatch.yaml
file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With