X-Git-Url: https://git.cyclocoop.org/%242?a=blobdiff_plain;f=maintenance%2FattachLatest.php;h=4da09018c4c264bb0673a15919d83eb2be01d62d;hb=1aba1d864c135740c2c37c7af30e2117be072769;hp=897972c75a6e2eda1963767b768462e6e4a3c228;hpb=2b6f3f0adc475da7eab1ef04dfe917e5536e6e10;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/attachLatest.php b/maintenance/attachLatest.php index 897972c75a..4da09018c4 100644 --- a/maintenance/attachLatest.php +++ b/maintenance/attachLatest.php @@ -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++; }