update function: only call pcntl_alarm() if it is defined

This commit is contained in:
Andrew Dolgov 2008-02-24 12:34:32 +01:00
parent 3c2d7945ae
commit 9a91a51e0d
1 changed files with 2 additions and 2 deletions

View File

@ -5365,10 +5365,10 @@
// We setup a alarm to alert if the feed take more than 300s to update. // We setup a alarm to alert if the feed take more than 300s to update.
// => HANG alarm. // => HANG alarm.
if(!$from_http) pcntl_alarm(300); if(!$from_http && function_exists('pcntl_alarm')) pcntl_alarm(300);
update_rss_feed($link, $line["feed_url"], $line["id"], true); update_rss_feed($link, $line["feed_url"], $line["id"], true);
// Cancel the alarm (the update went well) // Cancel the alarm (the update went well)
if(!$from_http) pcntl_alarm(0); if(!$from_http && function_exists('pcntl_alarm')) pcntl_alarm(0);
sleep(1); // prevent flood (FIXME make this an option?) sleep(1); // prevent flood (FIXME make this an option?)
} }