There is a function in php that sends an sms, it takes about 3 seconds to execute this function, during which the modem is busy and if the function is called again, it simply will not work. The function of sending SMS is called in a loop for a group of numbers, each time in a loop, doBackground () is executed; The worker has time to get rid of all the tasks in the queue at once in these 3 seconds and only the first SMS is sent. Is there any way to configure a pause or a timeout?

PS In parallel, I try to configure the modem status check in the SMS sending function itself, but so far unsuccessfully

  • After sending sleep(3) ? - ilyaplot

1 answer 1

The solution was found, he himself is guilty, set foot. If the worker spins one, then tasks will be executed in order in order until one completes - another will not start, so it is enough to register sleep(3) at the end of the function called by the worker and she will pass success only 3s after the function is called. Before that, I thought of it, but I forgot that I had to restart the worker again, it’s not enough just to edit the file, as I used to.

As soon as I restarted the worker, everything was fine.