Building Google Cloud Platform Solutions
上QQ阅读APP看书,第一时间看更新

Trying the App Engine cron service

To test out scheduled tasks, a simple cron.yaml definition file has been provided in chapter_04/example_05. This definition file will create a scheduled task to ping an admin-only endpoint on the default Python service we deployed earlier in this chapter. To create the scheduled task, run:

gcloud app deploy example_05/cron.yaml

Note that once deployed, this cron task will prevent the service from scaling to zero instances. To avoid any additional billable hours, the scheduled task can be deleted by running the following:

gcloud app deploy example_05/delete-cron.yaml