Run a task every hour per hour with the App Engine cron API

I need to run a task every hour at an o'clock (00:00, 01:00, 02:00, ..., 23:00) every day of the week, but it seems that I can not find an example in App Engine applications about how it to do.

There is an example of a start for every hour, but this does not work, because the "beginning" of this hour depends on when you deploy the application. That is, if I deploy at 4:37 pm, the cron scripts will be executed at 5:37, 6:37, ... instead of 5:00, 6:00, ...

So far, the only way to look like it is working is to have 24 different cron entries, one for a specific hour of every day that will run every day at that particular time.

Does anyone know something that will allow me to use a schedule, for example, "every hour at: 00" or even "every day 00:00, 01:00, ... 23:00"?

+3
source share
4 answers

You could do it and give up exactly at the hour, but it will be close ...

(An example from the application that I debugged)

cron:
- description: Description of what you want done...
  url: /script/path/goes/here
  schedule: every 60 minutes synchronized
  timezone: America/New_York

Below is a screenshot of the logs, the application is not receiving traffic right now, 99% of these entries are all cron entries.

enter image description here

--- change ---

Just re-read the documents and maybe it might be better

  schedule: every 60 minutes from 00:00 to 23:59
+5
source

, cron , . Task Queue . :

  • , " ", , , .
  • cron, 24 , .
+3

, 20 cron, .

​​, - .

0

, , 24 cron . , .

-1

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


All Articles