require_once __DIR__ . '/Maintenance.php';
use MediaWiki\MediaWikiServices;
-use Wikimedia\Rdbms\DBReplicationWaitError;
/**
* Maintenance script to update cached special pages.
}
public function execute() {
- global $wgQueryCacheLimit, $wgDisableQueryPageUpdate;
+ global $wgQueryCacheLimit;
$dbw = $this->getDB( DB_MASTER );
$this->doSpecialPageCacheUpdates( $dbw );
+ $disabledQueryPages = QueryPage::getDisabledQueryPages( $this->getConfig() );
foreach ( QueryPage::getPages() as $page ) {
- list( $class, $special ) = $page;
+ list( , $special ) = $page;
$limit = $page[2] ?? null;
# --list : just show the name of pages
}
if ( !$this->hasOption( 'override' )
- && $wgDisableQueryPageUpdate && in_array( $special, $wgDisableQueryPageUpdate )
+ && isset( $disabledQueryPages[$special] )
) {
$this->output( sprintf( "%-30s [QueryPage] disabled\n", $special ) );
continue;
$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 ) {