Reputation: 1157
I've just implemented modules on GAE and am trying to run a Cron job from a certain module. My app.yaml has following values at the top:
application: myapp
module: default
version: 1
runtime: python27
api_version: 1
threadsafe: true
handlers:
#all handlers
The reporting.yaml for the module I am trying to activate has the following settings:
application: myapp
module: reporting
version: 1
instance_class: B4
runtime: python27
api_version: 1
threadsafe: true
handlers:
#same handlers as app.yaml
Finally my cron.yaml looks as following:
cron:
- description: update reports
url: /update
schedule: every day 12:00
target: reporting
I need the module because the job requires more memory then the normal instance offers. For some reason however, when I look in the Logs of my app, it keeps executing the cron job on the default module. Why is it not accepting the target parameter?
Upvotes: 1
Views: 815
Reputation: 1157
Turns out I missed to upload the module itself with following command:
appcfg update app.yaml reporting.yaml
After doing this, the target parameter worked.
Upvotes: 1
Reputation: 6727
Please check the below text from GAE document - target element for version not module.
If the target parameter has been set for a job, the request is sent to the specified version.
How about forward cron job to your target module as like the below example code in GAE document?
import urllib2
from google.appengine.api import modules
url = "http://%s/" % modules.get_hostname(module="reporting")
try:
result = urllib2.urlopen(url)
doSomethingWithResult(result)
except urllib2.URLError, e:
handleError(e)
Upvotes: 0