X-Git-Url: https://git.wh0rd.org/?a=blobdiff_plain;f=update_daemon2.php;h=2fbdd8b8cde7db3b68be98c91ce6fe812d967b93;hb=ec25336d6a1a0f276200e2ddc33f592fcf0ab530;hp=c55a8aaaee319c5e2378f823e4687f54abb72366;hpb=f03a795de75b99332c6315ea36ff452f7b32ca6a;p=tt-rss.git diff --git a/update_daemon2.php b/update_daemon2.php index c55a8aaa..2fbdd8b8 100755 --- a/update_daemon2.php +++ b/update_daemon2.php @@ -1,10 +1,7 @@ -#!/usr/bin/php +#!/usr/bin/env php 30) { - update_daemon_common($link); - } else { + _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."); @@ -209,13 +277,16 @@ _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)"); + if ($nf > 0) { + _debug("Feeds processed: $nf; feeds/minute: " . sprintf("%.2d", $nf/((time()-$start_timestamp)/60))); + } + db_close($link); // We are in a fork. @@ -227,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(); }