I’ve had a simple one too, which wasn’t working well
My working one - except my Cloudflare Worker was pointed to the URL which executed a PHP script on the server side (to generate something else) and returned the content for me as “debug info” like “OK!”, that way I do not need to check the resposne as it’s always HTTP 200 (as far as the origin is working) + knowing the server setup and time needed to be executed (along the 100s of Cloudflare timeout):
Maybe a timezone difference(s) - for me I remember when looking when it triggered it was +/- 2 hours GMT - if it could be related to this somehow?, or it actually doesnt’ trigger at all, as you say at the specific given date & time?
It doesn’t trigger at all. I’m suspecting it’s bug, because when I check the scheduled logs panel, it shows that my function was triggered, but it wasn’t.
I’m deploying only using the CF UI. I’m not using wrangler cli. Furthermore, when I open the CF UI to test the scheduled cron, when I click on test button, the first click doesn’t call my function, because nothing is showed on network console neither on logs console. My worker is only called after second click on test button. (This behavior is really strange)
I’m suspecting that the same is happening with my worker, it is not called at a specific time, but when it’s called sequentially by the cron, the function is triggered.
Before I’m using 35 13 * * sat,fri,mon I was using 35 13 * * 1,5,6.
I’m only changed it, because I thought it could be wrong. So instead of using a Cron expression, i tried to use the Cron expression generator on the workers UI, and it returned this one 35 13 * * sat,fri,mon.
I have tested many times the trigger. When i was testing at each 5 minutes it was working, but i don’t need to run my worker each 5 minutes.
But when i changed it to 35 13 * * sat,fri,mon it didn’t work anymore. On the UI it appears like if it worked, but it didn’t.
Scheduled events don’t accept responses as return values. With the current code, even if the response isn’t OK, the UI will show an success status. If you want it to show an error, you’ll have to throw an exception.
Yes, the url is correct, and it’s on production. If i access my cron url directly, or by accessing my cf worker by it’s url adress, it is called. I could send the link here, but i think it would not be safe, because it will be public and at moment i don’t have any token accesss based control.
I have just make a another test. I removed all cron that i had set before and I created a new one with this expression: */5 * * * *. I don’t know if it’s a normal behavior or not, but i created this one at 15:20, and it was only called at 15:40, and now it’s been called every 5 minutes since then.