Hi,
Currently im using Laravel 4 for a few years now. And I really love it! But I have a questions how to solve a certain problem. To give an indication.
A user can plan an event on a certain start en and time. As soon as this starttime is reached it needs to execute a Command. (just a CURL exec with some params)
Currenty we are firing this on the commandline with exec (linux at command). But this is not very reliable cause the start and endtime can change so we need to remove this job from the system.
So what is the best approuch for this?
Would love to hear any ideas!
Jules
You can write the user's planned events to the events table. Surely they can be edited. Every minute (or more if the time is not so exact) a cron job runs a command, it can be an artisan command, which goes through the events table from the database and looks if it is time to start one of them.
Hi Mkblade,
Thanks for your reply. The events are already in the database with the correct timestamp. But looping threw the table to check if we need to start anything every 5 seconds. Would be rather resource consuming?
If running a single query with selection over one or two columns and no joins every few seconds is too much for your server/db to handle, you need to re-evaluate your hosting solution.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community