mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/DiscussionTools
synced 2024-11-27 09:43:30 +00:00
persistRevisionThreadItems: Allow processing current revisions only
Bug: T315510 Change-Id: Iecde2a0a74a08b938ad0a089ed6d69662a8f28b1
This commit is contained in:
parent
e309fba4c2
commit
fd3453d96c
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue