$config = $context->getConfig();
$factory = wfGetLBFactory();
- // Check if any transaction was too big
- $limit = $config->get( 'MaxUserDBWriteDuration' );
- $factory->forEachLB( function ( LoadBalancer $lb ) use ( $limit ) {
- $lb->forEachOpenConnection( function ( IDatabase $db ) use ( $limit ) {
- $time = $db->pendingWriteQueryDuration();
- if ( $limit > 0 && $time > $limit ) {
- throw new DBTransactionError(
- $db,
- wfMessage( 'transaction-duration-limit-exceeded', $time, $limit )->text()
- );
- }
- } );
- } );
// Commit all changes
- $factory->commitMasterChanges( __METHOD__ );
+ $factory->commitMasterChanges(
+ __METHOD__,
+ // Abort if any transaction was too big
+ array( 'maxWriteDuration' => $config->get( 'MaxUserDBWriteDuration' ) )
+ );
// Record ChronologyProtector positions
$factory->shutdown();
wfDebug( __METHOD__ . ': all transactions committed' );
if (
$request->getProtocol() == 'http' &&
(
- $request->getSession()->shouldForceHTTPS() ||
- // Check the cookie manually, for paranoia
$request->getCookie( 'forceHTTPS', '' ) ||
- // check for prefixed version that was used for a time in older MW versions
+ // check for prefixed version for currently logged in users
$request->getCookie( 'forceHTTPS' ) ||
// Avoid checking the user and groups unless it's enabled.
(