N
N
Nujabes372019-03-27 01:01:32
PHP
Nujabes37, 2019-03-27 01:01:32

How to run php script after 5 minutes?

Basically, I want to do something like this. Let's say the user has just registered and I need to send him an email, but not immediately, but after 5 minutes. Any ideas how this can be implemented? I would like the best possible solution, thanks!

Answer the question

In order to leave comments, you need to log in

3 answer(s)
M
Mysterion, 2019-03-27
@Nujabes37

When registering, set the status, conditionally, to 1. Using the script that is specified in cron, bypass all statuses from 1, send mail and set status 2.

D
Dmitry Kim, 2019-03-27
@kimono

You can create a task and put it in a queue with a delay of 5 minutes.

K
kl09, 2019-03-27
@kl09

Only it is better not to cron, but to write a demon.
All the same, infrastructure as code, not cron-job. sitting on the side.
In general, it is better to use queues for this

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question