Jump to content

How to perform an action after some minutes


Go to solution Solved by kicken,

Recommended Posts

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?

  • Solution

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.