async PHP cron job? is it possible?
I need to write a cron (php) script to get the html result from several
websites.
Let's say my database has 50 websites records (ie.
http://www.somewebsite.com/page.php). So the cron job will be set to run
every x mins. When it's running, it will load the records from database,
check the status of each websites then get the HTML result back from it
then analysis it.
My concern is, if the website from n'th record is not responding, or it
takes some time to load (ie. oversea website), then n+1's record won't be
run, not until n'th record is finished, then this cron job will take a
while to finish.
If I execute the script on a browser, then it can be easily handled by
using ajax async, however it's a cron job, so I have no idea how to handle
this situation.
No comments:
Post a Comment