Cron trigger twice

I have a trigger that I want to run every 59 minutes and it triggers twice but in the trigger log I see only once.
it triggers every hour at minute 59 and after exactly a minute (don’t know why).

1 Like

Consider setting the topic category to Developers - Workers so that your posts can be seen by the Workers developers.

Also, have you joined their Discord? Most developers usually communicate here.

2 Likes

I’m not sure I understand what you would like to do, you want to run the cron twice every 59 mins? If so, you can do this in your wranger.toml like so:

[triggers]
crons = ["*/59 * * * *", "*/59 * * * *"]

Also as erictung said, the Discord is there if you want faster support. Feel free to ping me over there if you have any problems!

No, I want to run only once every 59 minutes but cloudflare triggers it 2 times, the first after 59 minutes and the second exactly 1 minute after the first trigger.

What is the cron schedule you set? Just to make sure it’s correct before checking if it’s a Cloudflare bug…

That does look like a bug, let me test and notify the team

3 Likes

*/59 * * * *

1 Like

Can you post a screenshot of the table above the one you posted? But it does look like a bug, as @Walshy mentioned.

1 Like

I have deleted now but it was */59 * * * *

1 Like

It’s definitely a bug.

It even shows that double run in the estimated upcoming events.

3 Likes

I reported this to the team.

2 Likes

Somehow crontab.guru is also returning the same result…

https://crontab.guru/#*/59_*_*_*_*

image

Try 59 * * * * instead?

2 Likes

This would be at the 59th minute every hour, which is technically different.

The */59 * * * * one is every 59th minute, every 59 minutes, which is slightly more than 24 times a day.

1 Like

True.

1 Like

I guess this means the issues might be upstream, so not technically a Cloudflare bug, but a library bug.

1 Like

I’m not an expert in cron but, it looks like cron is not designed to run in intervals:

Oh, I never knew. This is interesting… So it’s meant to do this. Very weird.

So technically, a user can do something like every 1, 2, 3, 4, 5, 6, 10, 12, 15, 20, or 30 minutes (basically factors of 60), but not something larger than 30.

2 Likes

At this point it’s difficult to talk of one cron :slight_smile:

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.