3
votes

I am trying to deploy a node.js app to App Engine with a cron job. I added the cron.yaml file to the app (as instructed here: https://cloud.google.com/appengine/docs/flexible/nodejs/scheduling-jobs-with-cron-yaml) and deployed, but the job never gets executed.

cron.yaml:

cron:
- description: test cron job
  url: /api/crontest
  schedule: every 1 mins

The endpoint exists in my app and I can hit it directly from the browser, but it never executes from the cron.

The only thing I see in the logs is an occasional cron: unrecognized service, but it does not correspond with the one minute frequency.

What am I missing? Is cron supported in the platform?

1
maybe it should be every 1 minutes? - Igor Artamonov
@IgorArtamonov according to cloud.google.com/appengine/docs/flexible/java/…, every 1 mins should work. That is the page I was following when setting up the cron job. Unfortunately, the ultimate solution was on the previous page, and I missed it. See my answer below. - BamaPookie

1 Answers

7
votes

According to https://cloud.google.com/appengine/docs/flexible/java/yaml-configuration-files, I needed to run gcloud preview app deploy cron.yaml to deploy the cron.