X-Git-Url: https://git.wh0rd.org/?a=blobdiff_plain;f=update_daemon2.php;h=fa64b302d8464aee7836fc0db5112dba24f01a10;hb=dc5a8a21a88e1d13e3188cd4757b2c41471c70f7;hp=1b1044238c0bcf5cf1ab0e1477e097b57d98806b;hpb=dbaa4e4aac5e68c6d4714941ae99d3e4028410e5;p=tt-rss.git diff --git a/update_daemon2.php b/update_daemon2.php index 1b104423..fa64b302 100755 --- a/update_daemon2.php +++ b/update_daemon2.php @@ -1,9 +1,10 @@ -#!/usr/bin/php +#!/usr/bin/env php 30) { - update_daemon_common($link); - } else { + $nf = 0; + + _debug("Waiting before update [$j].."); + sleep($j*5); + $nf = update_daemon_common($link); + + if (rand(0,100) > 50) { $count = update_feedbrowser_cache($link); _debug("Feedbrowser updated, $count feeds processed."); @@ -218,10 +262,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. @@ -233,10 +283,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(); }