X-Git-Url: https://git.wh0rd.org/?a=blobdiff_plain;f=update_daemon2.php;h=cee61bb6e69ad52e3a5c6d93db0d025b2d5d2a34;hb=1a43a68cb107205d43fee40a1d71cc998d6abc74;hp=053a73d7d7a399f958f417e07a3fd74a4b423ee8;hpb=0618b81c0716002966b61f07324b552c542face6;p=tt-rss.git diff --git a/update_daemon2.php b/update_daemon2.php index 053a73d7..cee61bb6 100755 --- a/update_daemon2.php +++ b/update_daemon2.php @@ -1,12 +1,10 @@ -#!/usr/bin/php +#!/usr/bin/env php 50) { + if (rand(0,100) > 30) { update_daemon_common($link); } else { $count = update_feedbrowser_cache($link); - _debug("Finished, $count feeds processed."); + _debug("Feedbrowser updated, $count feeds processed."); + + purge_orphans($link, true); + + $rc = cleanup_tags($link, 14, 50000); + + _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)"); - + db_close($link); // We are in a fork. // We wait a little before exiting to avoid to be faster than our parent process. sleep(1); + + unlink(LOCK_DIRECTORY . "/$lock_filename"); + // We exit in order to avoid fork bombing. exit(0); }