Scheduled function is runnning every 1 hrs, instead of every 30 mins

203 views
Skip to first unread message

chaklad...@gmail.com

unread,
Dec 12, 2021, 8:48:45 PM12/12/21
to Firebase Google Group
I have set up the scheduled function as:

exports.cron = functions.pubsub.schedule('25/30 * * * *').timeZone('Asia/Kolkata').onRun(async (context) => {

So the function should run on every 30 mins starting from 00:25, as 00:55, 01:25, 01:55 and so on.

But the function is running at every 1 hour starting at 00:25, as 01:25, 02:25 and so on.

What's the problem here?

Andreas B

unread,
Dec 13, 2021, 3:52:47 AM12/13/21
to Firebase Google Group
Unix Crontab syntax seem to support either "25" (="run this at minute 25 of an hour") or "*/30" (="run this every 30 minutes"), but not "25/30". Comma-separated values (in your case "25,55 * * * *") might do the trick.

chaklad...@gmail.com

unread,
Dec 13, 2021, 10:56:53 AM12/13/21
to Firebase Google Group
Thanks, it worked!
Reply all
Reply to author
Forward
0 new messages