From 74314f448cbd642e76146292d707851796ec6d5a Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Fri, 14 Nov 2014 11:37:39 +0800 Subject: [PATCH] Prune.php --- Prune.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Prune.php b/Prune.php index e40a1f38..da83a428 100644 --- a/Prune.php +++ b/Prune.php @@ -37,13 +37,24 @@ class Pman_Core_Prune extends Pman function get($m="", $opts) { + // prune irrelivant stuff.. + $f = DB_DataObject::Factory('reader_article'); + $f->query(" + DELETE FROM Events where + event_when < NOW() - INTERVAL 6 MONTH + AND + action IN ('RELOAD', 'LOGIN') + LIMIT 100000 + "); + + $this->prune((int)$opts['months']); } function prune($inM) { // 40 seconds ? to delete 100K records.. - //DB_DataObject::debugLevel(1); + DB_DataObject::debugLevel(1); $f = DB_DataObject::Factory('reader_article'); $f->query(" DELETE FROM Events where -- 2.39.2