projects
/
Pman.Core
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
eae8435
)
Prune.php
author
Alan Knowles
<alan@roojs.com>
Fri, 14 Nov 2014 03:37:39 +0000
(11:37 +0800)
committer
Alan Knowles
<alan@roojs.com>
Fri, 14 Nov 2014 03:37:39 +0000
(11:37 +0800)
Prune.php
patch
|
blob
|
history
diff --git
a/Prune.php
b/Prune.php
index
e40a1f3
..
da83a42
100644
(file)
--- a/
Prune.php
+++ b/
Prune.php
@@
-37,13
+37,24
@@
class Pman_Core_Prune extends Pman
function get($m="", $opts)
{
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..
$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
$f = DB_DataObject::Factory('reader_article');
$f->query("
DELETE FROM Events where