Merge "persistRevisionThreadItems: Allow processing current revisions only"

This commit is contained in:
jenkins-bot 2022-08-26 16:45:55 +00:00 committed by Gerrit Code Review
commit 7b8d272e7c

View file

@ -49,6 +49,7 @@ class PersistRevisionThreadItems extends TableCleanup {
$this->addOption( 'rev', 'Revision ID to process', false, true, false, true );
$this->addOption( 'page', 'Page title to process', false, true, false, true );
$this->addOption( 'all', 'Process the whole wiki', false, false, false, false );
$this->addOption( 'current', 'Process current revisions only', false, false, false, false );
}
public function execute() {
@ -79,6 +80,12 @@ class PersistRevisionThreadItems extends TableCleanup {
return;
}
if ( $this->getOption( 'current' ) ) {
// runTable() doesn't provide a way to do a JOIN. This is equivalent, but it might have
// different performance characteristics. It should be good enough for a maintenance script.
$conds[] = 'rev_id IN ( SELECT page_latest FROM page )';
}
$this->runTable( [
'table' => 'revision',
'conds' => $conds,