Make attachLatest.php wait for DB replica lag
Change-Id: I4f402ba772d0b0dda8360eaacf11e318f659efc0
This commit is contained in:
parent
2cae063de0
commit
d66d388caa
1 changed files with 4 additions and 0 deletions
|
|
@ -24,6 +24,8 @@
|
|||
* @ingroup Maintenance
|
||||
*/
|
||||
|
||||
use MediaWiki\MediaWikiServices;
|
||||
|
||||
require_once __DIR__ . '/Maintenance.php';
|
||||
|
||||
/**
|
||||
|
|
@ -53,6 +55,7 @@ class AttachLatest extends Maintenance {
|
|||
$conds,
|
||||
__METHOD__ );
|
||||
|
||||
$lbFactory = MediaWikiServices::getInstance()->getDBLoadBalancerFactory();
|
||||
$n = 0;
|
||||
foreach ( $result as $row ) {
|
||||
$pageId = intval( $row->page_id );
|
||||
|
|
@ -78,6 +81,7 @@ class AttachLatest extends Maintenance {
|
|||
if ( $this->hasOption( 'fix' ) ) {
|
||||
$page = WikiPage::factory( $title );
|
||||
$page->updateRevisionOn( $dbw, $revision );
|
||||
$lbFactory->waitForReplication();
|
||||
}
|
||||
$n++;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue