X-Git-Url: https://git.wh0rd.org/?a=blobdiff_plain;f=update_daemon2.php;h=c87f0c10a60adcf7a69df11dd24ddb09756a4616;hb=4c2da349574869065a2014d775ef702f28c127a1;hp=6ccdbcb100e5a7fc2afd614563a1098159b92e76;hpb=9b27cec8c01ff231085bc2045d196ace85e299d9;p=tt-rss.git diff --git a/update_daemon2.php b/update_daemon2.php index 6ccdbcb1..c87f0c10 100755 --- a/update_daemon2.php +++ b/update_daemon2.php @@ -1,7 +1,7 @@ -#!/usr/bin/php +#!/usr/bin/env php 30) { - update_daemon_common($link); - } else { + if (rand(0,100) > 50) { $count = update_feedbrowser_cache($link); _debug("Feedbrowser updated, $count feeds processed."); @@ -219,10 +277,16 @@ _debug("Cleaned $rc cached tags."); + global $pluginhost; + $pluginhost->run_hooks($pluginhost::HOOK_UPDATE_TASK, "hook_update_task", $op); } _debug("Elapsed time: " . (time() - $start_timestamp) . " second(s)"); + if ($nf > 0) { + _debug("Feeds processed: $nf; feeds/minute: " . sprintf("%.2d", $nf/((time()-$start_timestamp)/60))); + } + db_close($link); // We are in a fork. @@ -234,10 +298,6 @@ // We exit in order to avoid fork bombing. exit(0); } - - // We wait a little time before the next fork, in order to let the first fork - // mark the feeds it update : - sleep(1); } $last_checkpoint = time(); }