From: Andrew Dolgov Date: Mon, 27 Feb 2006 08:40:53 +0000 (+0100) Subject: purge improvements in daemon X-Git-Tag: schema_freeze_for_1.1.4~38 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=3b3d116efb6b4d548c21faa762859a9b45633524;p=tt-rss.git purge improvements in daemon --- diff --git a/update_daemon.php b/update_daemon.php index 8eca25b5..da94050f 100644 --- a/update_daemon.php +++ b/update_daemon.php @@ -8,6 +8,8 @@ define('MAGPIE_CACHE_DIR', '/var/tmp/magpie-ttrss-cache-daemon'); define('DISABLE_SESSIONS', true); + define('PURGE_INTERVAL', 3600); // seconds + require_once "sanity_check.php"; require_once "config.php"; @@ -48,11 +50,15 @@ pg_query("set client_encoding = 'utf-8'"); } + $last_purge = 0; + while (true) { - - print "Purging old posts...\n"; - global_purge_old_posts($link, false); + if (time() - $last_purge > PURGE_INTERVAL) { + print "Purging old posts...\n"; + global_purge_old_posts($link, true); + $last_purge = time(); + } // FIXME: get all scheduled updates w/forced refetch // Stub, until I figure out if it is really needed.