CRON schedule not working
wrldz
PROOP

2 years ago

Just encountered this issue last night where the scheduled CRON is not getting triggered. It runs every 5mins as of this writing. What workaround should I do?

19 Replies

2 years ago

Is this something that happens every 5 minutes? or is it intermittent?

What kind of app are you running on the CRON schedule?


wrldz
PROOP

2 years ago

I left it last night on that schedule and it did not run at all. I am calling an API that saves something on a database.


2 years ago

What cron expression do you have set?

Does the app exit as soon as it's done it's task?


wrldz
PROOP

2 years ago

*/5 * * * *

It says it will run in 3 seconds, 3 seconds have passed it did not trigger anything.

Then I wait another 5 minutes till the countdown, same.


2 years ago

Please answer the second question I asked.


wrldz
PROOP

2 years ago

I don't know how to answer it.

Status of the run are below when it gets triggered:

Deploying

Active

Completed

But since it's not triggered, no history is saved at all.


2 years ago

No worries, please let me know when you are able to answer.


wrldz
PROOP

2 years ago

Not sure if this will help but my script "exits" after each run.

Also, the schedule was working OK before. I just started to encounter this last night - it was not triggered at all.


2 years ago

Does the task take longer than 5 minutes?


wrldz
PROOP

2 years ago

Not at all. It only runs for less than 30 seconds.


2 years ago

Are you able to confirm that it does exit after it's done?


wrldz
PROOP

2 years ago

It does -- I have a logs that says my program is done.

I have set it to run every 15mins now, so far this works. But for my program, I have to run it as frequent as possible so ~3mins is my target.


2 years ago

To be honest in don't even think you can do a 5 minute frequency on the Hobby plan, you might be far better off doing an in code cron scheduler.


wrldz
PROOP

2 years ago

That makes sense. Thank you for the insight!


2 years ago

Let me know how the in code cron scheduler works!


federicopetraccaro
HOBBY

2 years ago

Related to this question, I have around 10 cron jobs, each scheduled to run once a day and at different times from one another. I am exepriencing that some (not always the same) do not start the cron job. The behaviour is quite strange because not always the same cron jobs are involved. This is making the whole process very unreliable for my app. Any idea or suggestion? Thank you


2 years ago

My suggestion would be the same as the previous suggestion I gave, switch to an in-coce scheduler.


federicopetraccaro
HOBBY

2 years ago

Thanks for your answer. From a technical standpoint, is the cron job failure due to the hobbly plan resources? would upgrading plan solve the issue and guarantee reliability in the cron sheduler ?


brody

My suggestion would be the same as the previous suggestion I gave, switch to an in-coce scheduler.

Anonymous
PRO

6 months ago

what is an in-code scheduler? any documentation on how to do this?


Welcome!

Sign in to your Railway account to join the conversation.

Loading...