diff options
author | Andrew Dolgov <[email protected]> | 2006-02-27 09:40:53 +0100 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2006-02-27 09:40:53 +0100 |
commit | 3b3d116efb6b4d548c21faa762859a9b45633524 (patch) | |
tree | 7ad751b1df498da8d39534982e83b6f8a32c41d3 | |
parent | 4c059b7bf9a2e47ea5fa3dee583f7e7ca45decef (diff) |
purge improvements in daemon
-rw-r--r-- | update_daemon.php | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/update_daemon.php b/update_daemon.php index 8eca25b59..da94050fc 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. |