diff options
author | Andrew Dolgov <[email protected]> | 2013-04-16 20:34:20 +0400 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2013-04-16 20:34:20 +0400 |
commit | e2261e177bc9f5308185d91783ca128000c6fd87 (patch) | |
tree | 086faf89f0ef1efa5ca6db1cb880b6cdecb7ea98 /include/rssfuncs.php | |
parent | b8c7f8357d4858ec1bf42bd8c990413ce75dd080 (diff) |
implement old log entry purging in update_daemon_common; add some more error types; tweak error log display
Diffstat (limited to 'include/rssfuncs.php')
-rw-r--r-- | include/rssfuncs.php | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/include/rssfuncs.php b/include/rssfuncs.php index b3bf25849..0a20f5d8e 100644 --- a/include/rssfuncs.php +++ b/include/rssfuncs.php @@ -148,6 +148,7 @@ expire_cached_files($debug); expire_lock_files($debug); + expire_error_log($link, $debug); $nf = 0; @@ -1197,6 +1198,19 @@ return $doc->saveXML($node); } + function expire_error_log($link, $debug) { + if ($debug) _debug("Removing old error log entries..."); + + if (DB_TYPE == "pgsql") { + db_query($link, "DELETE FROM ttrss_error_log + WHERE created_at < NOW() - INTERVAL '7 days'"); + } else { + db_query($link, "DELETE FROM ttrss_error_log + WHERE created_at < DATE_SUB(NOW(), INTERVAL 7 DAY)"); + } + + } + function expire_lock_files($debug) { if ($debug) _debug("Removing old lock files..."); |