View Single Post
  #3 (permalink)  
Old 23-12-04
Rich Rich is offline
Super Moderator
 
Join Date: Aug 2003
Posts: 2,451
Thanks: 0
Thanked 0 Times in 0 Posts
Rich is an unknown quantity at this point
To make it pause for a bit add a line like: -
sleep(5);

to make it pause for 5 seconds, this is always a good idea to save hosts resources on long jobs that arn't time critical.

But that won't get you past the 30 second time out to get past that the safest way is to reset the counter between each feed by adding a line like: -
set_time_limit(30);

This resets the time limit at that point, so what you want to do is

// get feed 1
sleep(5);
set_time_limit(30);
// get feed 2
sleep(5);
set_time_limit(30);
// get feed 3
etc

This means that each feed has got 25 seconds to process (30-5) and if any feed gets stuck in loop the script will still time out. The other option is to use set_time_limit(0); which totally turns off the time limit, but don't expect your hosts to be happy if you accidently set of a script that gets stuck in a loop as it will run forever.
Reply With Quote