Localisation updates from https://translatewiki.net.
[lhc/web/wiklou.git] / includes / MediaWiki.php
index e29319b..aee6ee1 100644 (file)
@@ -511,6 +511,13 @@ class MediaWiki {
                        $expires = time() + $this->config->get( 'DataCenterUpdateStickTTL' );
                        $request->response()->setCookie( 'UseDC', 'master', $expires );
                }
+
+               // Avoid letting a few seconds of slave lag cause a month of stale data
+               if ( $factory->laggedSlaveUsed() ) {
+                       $maxAge = $this->config->get( 'CdnMaxageLagged' );
+                       $this->context->getOutput()->lowerCdnMaxage( $maxAge );
+                       wfDebugLog( 'replication', "Lagged DB used; CDN cache TTL limited to $maxAge seconds" );
+               }
        }
 
        /**
@@ -683,7 +690,7 @@ class MediaWiki {
                Profiler::instance()->getTransactionProfiler()->resetExpectations();
 
                // Do any deferred jobs
-               DeferredUpdates::doUpdates( 'commit' );
+               DeferredUpdates::doUpdates( 'commit', 'enqueue' );
 
                // Make sure any lazy jobs are pushed
                JobQueueGroup::pushLazyJobs();