require_once __DIR__ . '/Maintenance.php';
use MediaWiki\MediaWikiServices;
-use Wikimedia\Rdbms\DBReplicationWaitError;
/**
* Maintenance script to update cached special pages.
continue;
}
- $specialObj = SpecialPageFactory::getPage( $special );
+ $specialObj = MediaWikiServices::getInstance()->getSpecialPageFactory()->
+ getPage( $special );
if ( !$specialObj ) {
$this->output( "No such special page: $special\n" );
exit;
if ( $queryPage->isExpensive() ) {
$t1 = microtime( true );
# Do the query
- $num = $queryPage->recache( $limit === null ? $wgQueryCacheLimit : $limit );
+ $num = $queryPage->recache( $limit ?? $wgQueryCacheLimit );
$t2 = microtime( true );
if ( $num === false ) {
$this->output( "FAILED: database error\n" );
$this->output( "Reconnected\n\n" );
}
// Wait for the replica DB to catch up
- try {
- $lbFactory->waitForReplication();
- } catch ( DBReplicationWaitError $e ) {
- // ignore
- }
+ $lbFactory->waitForReplication();
}
public function doSpecialPageCacheUpdates( $dbw ) {