Unexpected behaviour in scheduled firebase function

Viewed 40

I have a firebase scheduled function with the crontab expression: 0 2-22/2 * * *

As I understand it, this function should be run every two hours every day, apart from at midnight.

However, the function was just triggered at midnight, so I must be doing something wrong. Here is the code I wrote for the function scheduling:

exports.everyTwoHourRunGame = functions
  .runWith({
    timeoutSeconds: 540,
  })
  .pubsub.schedule("0 2-22/2 * * *")
  .onRun(async () => {

On the firebase website, I can view the logs for the function and see that it ran the second after 00:00, other than this it has been working fine, executing every two hours as expected.

Any help would be much appreciated.

0 Answers
Related