Cyberking Posted March 24, 2022 Share Posted March 24, 2022 Good day, please I have something to achieve. I am working on a dispatch app and when a request is made, I want to get the closest 5 riders and assign the request to them. I will take the first rider and send a notification to him, If he accepts, then that's all but if he declines, I send to the next rider; but if he doesn't accept or decline after 3 minutes, I will move to the next rider. I am able to get everything to work except for the part of "if he doesn't accept or reject after 3 minutes, I will move to the next rider". Any solution to this? Quote Link to comment https://forums.phpfreaks.com/topic/314618-how-to-perform-an-action-after-some-minutes/ Share on other sites More sharing options...
Solution kicken Posted March 24, 2022 Solution Share Posted March 24, 2022 Create a script that you can run every minute and it will check if there are any expired requests. If there are it will do the "move on to the next rider" stuff. Once that is working, create a cron job/scheduled task to execute that script every minute. Quote Link to comment https://forums.phpfreaks.com/topic/314618-how-to-perform-an-action-after-some-minutes/#findComment-1594507 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.