Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

KrisTP's avatar

Schedule:run from a Scheduled Function instead of a cron?

In my two weeks of struggling to deploy on Digital Ocean Apps I never managed to get the cron to work. So an interesting idea popped into my head:

Digital Ocean has "Functions" you can automatically execute every minute, much like a cron. So what if instead of running a cron, I create such a function.

The function would make a curl request to the API, which in turn would execute "schedule:run". This would happen every minute.

Do crons do anything magic other than calling the function every minute? Wouldn't the result be the same?

0 likes
9 replies
KrisTP's avatar

@vincent15000 Yes I realise that. My question is if in situations where a cron is not viable, of triggering schedule:run every minute in other ways (such as "Scheduled Functions" in Digital Ocean) is a good alternative.

1 like
vincent15000's avatar

@KrisTP I don't know Digital Ocean, but what you say seems to be a cron task on Digital Ocean. Furthermore the Laravel documentation says that the cron configuration will execute schedule:run every minute, so it's exactly the same as what would be done with a crontab configuration.

So sure what you want to do seems to be a good alternative.

Otherwise have you seen this documentation about Digital Ocean ?

https://docs.digitalocean.com/developer-center/how-to-setup-a-job-scheduler-on-digitalocean-app-platform/

1 like
KrisTP's avatar

@vincent15000 yes, I've seen that page. Unfortunately I did not get Docker to successfully deploy after many days of trying, so I had to come up with an alternative solution.

If my idea is valid and I'm not making a big mistake by doing it this way, I can be up and running really fast and leave the Docker mess behind me.

1 like
vincent15000's avatar

@KrisTP I don't know Docker and I really don't understand why Docker could be useful in this case.

According to me, there is no mistake by running schedule:run every minute via a Digital Ocean configuration given that via a crontab configuration the schedule:run command is executed every minute too.

So, when using Laravel's scheduler, we only need to add a single cron configuration entry to our server that runs the schedule:run command every minute.

https://laravel.com/docs/10.x/scheduling#running-the-scheduler

vincent15000's avatar

@KrisTP If you have solved your problem, don't forget to close the post by assigning the best answer ;).

KrisTP's avatar

@Snapey cost is a consideration. I just did some calculations and I think I'll stay within the free tier. The scheduled tasks aren't that complex. There are some e-mails being sent, but those are queued.

1 like
Snapey's avatar

@KrisTP I assume the free tier is also shared by your app server?

1 like

Please or to participate in this conversation.