}
} catch ( Exception $e ) {
$context = $this->context;
+ $action = $context->getRequest()->getVal( 'action', 'view' );
if (
$e instanceof DBConnectionError &&
$context->hasTitle() &&
$context->getTitle()->canExist() &&
- $context->getRequest()->getVal( 'action', 'view' ) === 'view' &&
+ in_array( $action, [ 'view', 'history' ], true ) &&
HTMLFileCache::useFileCache( $this->context, HTMLFileCache::MODE_OUTAGE )
) {
// Try to use any (even stale) file during outages...
/**
* @param string $url
* @param IContextSource $context
- * @return string|bool Either "local" or "remote" if in the farm, false otherwise
+ * @return string Either "local", "remote" if in the farm, "external" otherwise
*/
- private function getUrlDomainDistance( $url, IContextSource $context ) {
+ private static function getUrlDomainDistance( $url, IContextSource $context ) {
static $relevantKeys = [ 'host' => true, 'port' => true ];
$infoCandidate = wfParseUrl( $url );
if ( $infoCandidate === false ) {
- return false;
+ return 'external';
}
$infoCandidate = array_intersect_key( $infoCandidate, $relevantKeys );
}
}
- return false;
+ return 'external';
}
/**
// Do any deferred jobs
DeferredUpdates::doUpdates( 'enqueue' );
+ DeferredUpdates::setImmediateMode( true );
// Make sure any lazy jobs are pushed
JobQueueGroup::pushLazyJobs();