Merge "mw.page.gallery: Prevent jumpiness due to viewport height changes"
[lhc/web/wiklou.git] / includes / MediaWiki.php
index 82ffcfb..459a7e1 100644 (file)
@@ -636,9 +636,11 @@ class MediaWiki {
 
                if ( $cpIndex > 0 ) {
                        if ( $allowHeaders ) {
-                               $expires = time() + ChronologyProtector::POSITION_TTL;
+                               $now = time();
+                               $expires = $now + ChronologyProtector::POSITION_COOKIE_TTL;
                                $options = [ 'prefix' => '' ];
-                               $request->response()->setCookie( 'cpPosIndex', $cpIndex, $expires, $options );
+                               $value = LBFactory::makeCookieValueFromCPIndex( $cpIndex, $now ); // T190082
+                               $request->response()->setCookie( 'cpPosIndex', $value, $expires, $options );
                        }
 
                        if ( $strategy === 'cookie+url' ) {
@@ -998,8 +1000,14 @@ class MediaWiki {
         * @param LoggerInterface $runJobsLogger
         */
        private function triggerSyncJobs( $n, LoggerInterface $runJobsLogger ) {
-               $runner = new JobRunner( $runJobsLogger );
-               $runner->run( [ 'maxJobs' => $n ] );
+               $trxProfiler = Profiler::instance()->getTransactionProfiler();
+               $old = $trxProfiler->setSilenced( true );
+               try {
+                       $runner = new JobRunner( $runJobsLogger );
+                       $runner->run( [ 'maxJobs' => $n ] );
+               } finally {
+                       $trxProfiler->setSilenced( $old );
+               }
        }
 
        /**