X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=maintenance%2FattachLatest.php;h=e1d7fca7e7fab9f4715ed0a10ac7e3ed8d6d3a9e;hp=897972c75a6e2eda1963767b768462e6e4a3c228;hb=6cfb2e3d7a2b96d5041312fcec88248bb46573d7;hpb=16c80e429be5904fb42a93f260f8de3d18f0c692 diff --git a/maintenance/attachLatest.php b/maintenance/attachLatest.php index 897972c75a..e1d7fca7e7 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,9 @@ class AttachLatest extends Maintenance { $conds, __METHOD__ ); + $lbFactory = MediaWikiServices::getInstance()->getDBLoadBalancerFactory(); + $dbDomain = $lbFactory->getLocalDomainID(); + $n = 0; foreach ( $result as $row ) { $pageId = intval( $row->page_id ); @@ -63,21 +68,23 @@ class AttachLatest extends Maintenance { [ 'rev_page' => $pageId ], __METHOD__ ); if ( !$latestTime ) { - $this->output( wfWikiID() . " $pageId [[$name]] can't find latest rev time?!\n" ); + $this->output( "$dbDomain $pageId [[$name]] can't find latest rev time?!\n" ); continue; } $revision = Revision::loadFromTimestamp( $dbw, $title, $latestTime ); if ( is_null( $revision ) ) { - $this->output( wfWikiID() - . " $pageId [[$name]] latest time $latestTime, can't find revision id\n" ); + $this->output( + "$dbDomain $pageId [[$name]] latest time $latestTime, can't find revision id\n" + ); continue; } $id = $revision->getId(); - $this->output( wfWikiID() . " $pageId [[$name]] latest time $latestTime, rev id $id\n" ); + $this->output( "$dbDomain $pageId [[$name]] latest time $latestTime, rev id $id\n" ); if ( $this->hasOption( 'fix' ) ) { $page = WikiPage::factory( $title ); $page->updateRevisionOn( $dbw, $revision ); + $lbFactory->waitForReplication(); } $n++; }