J
J
jekahm2017-02-14 10:55:05
Task Schedulers
jekahm, 2017-02-14 10:55:05

Running cron every 5 seconds?

Good day!
I would like to receive sensible advice from experienced specialists.
There is a PHP project that displays live football match data. He receives this information from a sports data provider. For this, only one url is used , which contains an xml file with up-to-date data, and which is updated on their side at a certain interval (5-10 seconds).
Updating the data, in turn, is already done on our side by cron. But there is a question here. How to make cron run every 5 seconds but check if a previous instance is running. If it is running, then, accordingly, a new instance is not launched (as it happens that the data parsing process can run from 3 to 10 seconds).
Thanks in advance!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Acidter, 2018-07-02
@Acidter

Cron itself does not allow you to execute a task more than once a minute. But there is a life hack https://timeweb.com/ru/community/articles/cron-nas...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question