[FileJournal] Randomly prune old log entries.
[lhc/web/wiklou.git] / includes / filebackend / filejournal / DBFileJournal.php
index 34f3e53..44c6567 100644 (file)
@@ -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;