I created a Google Cloud function that gets data and dumps it into a Google SQL Database. I need this function to execute every 15 minutes. As I understand it you cannot execute cloud functions in a cron job. The workaround is to deploy an app in the App engine.
I've deployed a simple NodeJS application that makes an http request using the NodeJS https module. I've deployed this app to Google App Engine along with the following cron.yaml
cron:
- description: "Gets new data every 15 minutes"
url: /
schedule: every 15 mins
But this is not executing and it is not showing up in the cron jobs list. Does the above cron job syntax look correct?
Is there anything else I need to do to get Google App Engine to pick up this cron job?
tyia
The App Engine Cron Service allows you to configure regularly scheduled tasks that operate at defined times or regular intervals. These tasks are commonly known as cron jobs.
I had mistakingly thought that cron.yaml would be deployed as a cron job when I executed gcloud app deploy
To deploy the cron job I had to explicitly deploy cron.yaml
gcloud app deploy cron.yaml
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