GAE cron job shuts down unexpectedly

I have a cron job configured in cron.xml in an application in Google App Engine.
These jobs work once a day in the version of my application and do some work on db.
For example, a cron job calls v1.myapp.appspot.com ...

After a few weeks, this instance of the application no longer works. It does not complete cron jobs as I expect.

In the GAE Dashboard, I found a section with a list of cron jobs, but I can't see my cron work orders.

Why did they disappear? What happened to my configuration environment? or Why is Google stopping my cron jobs?

0
source share
1 answer

The cron job configuration is the configuration of the entire application area; it is not the configuration of a specific service / version. Each cron deployment (which can be performed without the need to update the service / version) will overwrite the previously deployed.

To avoid random errors, I personally have one application-level cron configuration file, symbolically linked inside each service as needed.

If you want to save the cron job for an older version, you need to add a configuration entry for it for the purpose corresponding to this service / version, otherwise the cron job will stop working if this version is no longer the default (since the requests initiated by cron will be directed to the default service / version):

From Creating a cron Job :

<?xml version="1.0" encoding="UTF-8"?> <cronentries> <cron> <url>/tasks/summary</url> <target>beta</target> <description>daily summary job</description> <schedule>every 24 hours</schedule> </cron> </cronentries> 

The target specification is optional and is the name of the service / version. If present, the target is added to your application. hostname, as a result of which the task should be redirected to this service / version. If no target is specified, the task will be executed in the standard version by default.

0
source

Source: https://habr.com/ru/post/1268351/


All Articles