Gergő Tisza has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/350839 )

Change subject: Add batch size option for PurgeScoreCache
......................................................................

Add batch size option for PurgeScoreCache

Change-Id: Id3a9219cac939c4cf9d35d6beffac904ead535a5
---
M maintenance/PurgeScoreCache.php
1 file changed, 4 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ORES 
refs/changes/39/350839/1

diff --git a/maintenance/PurgeScoreCache.php b/maintenance/PurgeScoreCache.php
index a3dca27..49a69ee 100644
--- a/maintenance/PurgeScoreCache.php
+++ b/maintenance/PurgeScoreCache.php
@@ -23,6 +23,7 @@
                        'even those from the most recent model', false, false );
                $this->addOption( 'old', 'Flag to indicate that we only want to 
clear old data ' .
                        'that is not in recent changes anymore. Implicitly 
assumes --all.', false, false );
+               $this->setBatchSize( 1000 );
        }
 
        public function execute() {
@@ -35,13 +36,13 @@
                $this->output( "Purging ORES scores:\n" );
                foreach ( $models as $model ) {
                        if ( $this->hasOption( 'old' ) ) {
-                               $deletedRows = Cache::instance()->purgeOld( 
$model );
+                               $deletedRows = Cache::instance()->purgeOld( 
$model, $this->mBatchSize );
                                $description = 'old rows';
                        } elseif ( $this->hasOption( 'all' ) ) {
-                               $deletedRows = Cache::instance()->purge( 
$model, true );
+                               $deletedRows = Cache::instance()->purge( 
$model, true, $this->mBatchSize );
                                $description = 'old model versions';
                        } else {
-                               $deletedRows = Cache::instance()->purge( 
$model, false );
+                               $deletedRows = Cache::instance()->purge( 
$model, false, $this->mBatchSize );
                                $description = 'all rows';
                        }
                        if ( $deletedRows ) {

-- 
To view, visit https://gerrit.wikimedia.org/r/350839
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id3a9219cac939c4cf9d35d6beffac904ead535a5
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ORES
Gerrit-Branch: master
Gerrit-Owner: GergÅ‘ Tisza <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to