X-Git-Url: https://git.wh0rd.org/?a=blobdiff_plain;f=update_daemon2.php;h=a1d7e7d66a35c7cca0e0370726762f98ffb5a733;hb=eefaa2df381686f771396baae2d0ae71b345c2e7;hp=6410709adf37882be1df4a7dc51bc663f4c13bd4;hpb=9765e8b9f1037541080aaeb24d6a99a14247a8b7;p=tt-rss.git diff --git a/update_daemon2.php b/update_daemon2.php index 6410709a..a1d7e7d6 100755 --- a/update_daemon2.php +++ b/update_daemon2.php @@ -1,10 +1,7 @@ #!/usr/bin/env php 30) { - update_daemon_common($link); - } else { - $count = update_feedbrowser_cache($link); + if (rand(0,100) > 50) { + $count = update_feedbrowser_cache(); _debug("Feedbrowser updated, $count feeds processed."); - purge_orphans($link, true); + purge_orphans( true); - $rc = cleanup_tags($link, 14, 50000); + $rc = cleanup_tags( 14, 50000); _debug("Cleaned $rc cached tags."); - _debug("Updating linked feeds..."); - get_linked_feeds($link); - + global $pluginhost; + $pluginhost->run_hooks($pluginhost::HOOK_UPDATE_TASK, "hook_update_task", $op); } _debug("Elapsed time: " . (time() - $start_timestamp) . " second(s)"); - db_close($link); + if ($nf > 0) { + _debug("Feeds processed: $nf"); + + if (time() - $start_timestamp > 0) { + _debug("Feeds/minute: " . sprintf("%.2d", $nf/((time()-$start_timestamp)/60))); + } + } // We are in a fork. // We wait a little before exiting to avoid to be faster than our parent process. @@ -228,10 +295,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(); }