From: Aaron Schulz Date: Wed, 7 Nov 2012 22:21:23 +0000 (-0800) Subject: [FileJournal] Randomly prune old log entries. X-Git-Tag: 1.31.0-rc.0~21694 X-Git-Url: http://git.cyclocoop.org/data/Luca_Pacioli_%28Gemaelde%29.jpeg?a=commitdiff_plain;h=9dc6ffe9f9dfc583ee07368205b82c20fd5d1fef;p=lhc%2Fweb%2Fwiklou.git [FileJournal] Randomly prune old log entries. Change-Id: I667bfdaf167f2154d833b06de7115b4b292a0d2b --- diff --git a/includes/filebackend/filejournal/DBFileJournal.php b/includes/filebackend/filejournal/DBFileJournal.php index 34f3e53d50..44c6567b6a 100644 --- a/includes/filebackend/filejournal/DBFileJournal.php +++ b/includes/filebackend/filejournal/DBFileJournal.php @@ -75,6 +75,9 @@ class DBFileJournal extends FileJournal { try { $dbw->insert( 'filejournal', $data, __METHOD__ ); + if ( mt_rand( 0, 99 ) == 0 ) { + $this->purgeOldLogs(); // occasionally delete old logs + } } catch ( DBError $e ) { $status->fatal( 'filejournal-fail-dbquery', $this->backend ); return $status;