X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FSetup.php;h=d6f4b2fe4c0b28cf9ee57e240dd0f0ad83ec8fa1;hb=8f76e361fa7a0d8fc24e7b6f2d73b9c70369a6ef;hp=081ea683639148881e6644e40c6a0bffcbf1acbb;hpb=929072a0c244d166be5c5359ad020956a806544e;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/Setup.php b/includes/Setup.php index 081ea68363..d6f4b2fe4c 100644 --- a/includes/Setup.php +++ b/includes/Setup.php @@ -736,17 +736,20 @@ if ( !$wgDBerrorLogTZ ) { // Initialize the request object in $wgRequest $wgRequest = RequestContext::getMain()->getRequest(); // BackCompat -// Set user IP/agent information for causal consistency purposes +// Set user IP/agent information for causal consistency purposes. +// The cpPosTime cookie has no prefix and is set by MediaWiki::preOutputCommit(). +$cpPosTime = $wgRequest->getFloat( 'cpPosTime', $wgRequest->getCookie( 'cpPosTime', '' ) ); MediaWikiServices::getInstance()->getDBLoadBalancerFactory()->setRequestInfo( [ 'IPAddress' => $wgRequest->getIP(), 'UserAgent' => $wgRequest->getHeader( 'User-Agent' ), 'ChronologyProtection' => $wgRequest->getHeader( 'ChronologyProtection' ), - // The cpPosTime cookie has no prefix and is set by MediaWiki::preOutputCommit() - 'ChronologyPositionTime' => $wgRequest->getFloat( - 'cpPosTime', - $wgRequest->getCookie( 'cpPosTime', '' ) - ) + 'ChronologyPositionTime' => $cpPosTime ] ); +// Make sure that caching does not compromise the consistency improvements +if ( $cpPosTime ) { + MediaWikiServices::getInstance()->getMainWANObjectCache()->useInterimHoldOffCaching( false ); +} +unset( $cpPosTime ); // Useful debug output if ( $wgCommandLineMode ) {