filecache: Use current action instead of "view" only in outage mode
[lhc/web/wiklou.git] / includes / MediaWiki.php
index 0fd6b92..19e827d 100644 (file)
@@ -282,7 +282,7 @@ class MediaWiki {
                        }
 
                        // Special pages ($title may have changed since if statement above)
-                       if ( NS_SPECIAL == $title->getNamespace() ) {
+                       if ( $title->isSpecialPage() ) {
                                // Actions that need to be made when we have a special pages
                                SpecialPageFactory::executePath( $title, $this->context );
                        } else {
@@ -539,7 +539,7 @@ class MediaWiki {
                                HTMLFileCache::useFileCache( $this->context, HTMLFileCache::MODE_OUTAGE )
                        ) {
                                // Try to use any (even stale) file during outages...
-                               $cache = new HTMLFileCache( $context->getTitle(), 'view' );
+                               $cache = new HTMLFileCache( $context->getTitle(), $action );
                                if ( $cache->isCached() ) {
                                        $cache->loadFromFileCache( $context, HTMLFileCache::MODE_OUTAGE );
                                        print MWExceptionRenderer::getHTML( $e );
@@ -898,12 +898,11 @@ class MediaWiki {
                        __METHOD__
                );
 
+               // Important: this must be the last deferred update added (T100085, T154425)
+               DeferredUpdates::addCallableUpdate( [ JobQueueGroup::class, 'pushLazyJobs' ] );
+
                // Do any deferred jobs
                DeferredUpdates::doUpdates( 'enqueue' );
-               DeferredUpdates::setImmediateMode( true );
-
-               // Make sure any lazy jobs are pushed
-               JobQueueGroup::pushLazyJobs();
 
                // Now that everything specific to this request is done,
                // try to occasionally run jobs (if enabled) from the queues