Answer the question
In order to leave comments, you need to log in
How to make script work without user?
Hello, I want to make on my site so that when a person leaves the site, a certain script continues to work on behalf of the user. Who can help or already throw off the mini code.
Answer the question
In order to leave comments, you need to log in
You save user tasks in a table, write a script that performs tasks from this table and hang them on cron.
you can try pcnt_fork if you need to do something without the user waiting. But a small script run time can be set. There is also fastcgi_finish_request . Give the user data, call the function, the client is given a response, and the script continues to work further.
But still, if this is needed often, it is better to use a queue, since fork creates a copy of the process.
You buy an Indian on upwork and make you press F5 on the page every 5 seconds
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question