Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set LoadMonitor #5759

Merged
merged 2 commits into from
Dec 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion Database.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,14 @@
];
}

$wgLBFactoryConf['loadMonitor']['class'] = '\Wikimedia\Rdbms\LoadMonitor';
// Disable LoadMonitor in CLI, it doesn't provide much value in CLI.
if ( PHP_SAPI === 'cli' ) {
$wgLBFactoryConf['loadMonitorClass'] = \Wikimedia\Rdbms\LoadMonitorNull::class;
$wgLBFactoryConf['loadMonitor']['class'] = '\Wikimedia\Rdbms\LoadMonitorNull';
}

$wgLBFactoryConf['loadMonitor']['maxConnCount'] = 350;

// Disallow web request database transactions that are slower than 10 seconds
$wgMaxUserDBWriteDuration = 10;

Expand Down
6 changes: 3 additions & 3 deletions LocalWiki.php
Original file line number Diff line number Diff line change
Expand Up @@ -697,13 +697,13 @@ function onBeforePageDisplay( OutputPage $out ) {

break;
case 'testwikibeta':
$wgUserLevels = array(
$wgUserLevels = [
'Recruit' => 0,
'Apprentice' => 1200,
'Private' => 1750,
'Corporal' => 2500,
'Sergeant' => 5000,
'Gunnery Sergeant' =>10000,
'Gunnery Sergeant' => 10000,
'Lieutenant' => 20000,
'Captain' => 35000,
'Major' => 50000,
Expand All @@ -716,7 +716,7 @@ function onBeforePageDisplay( OutputPage $out ) {
'Lieutenant General' => 650000,
'General' => 800000,
'General of the Army' => 1000000,
);
];
break;
case 'tuscriaturaswiki':
$wgHooks['AfterFinalPageOutput'][] = 'onAfterFinalPageOutput';
Expand Down
2 changes: 1 addition & 1 deletion rpc/RunJobs.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

use MediaWiki\MediaWikiServices;

if ( !in_array( $_SERVER['REMOTE_ADDR'], array( '127.0.0.1', '0:0:0:0:0:0:0:1', '::1' ), true ) ) {
if ( !in_array( $_SERVER['REMOTE_ADDR'], [ '127.0.0.1', '0:0:0:0:0:0:0:1', '::1' ], true ) ) {
http_response_code( 500 );
die( "Only loopback requests are allowed.\n" );
} elseif ( $_SERVER['REQUEST_METHOD'] !== 'POST' ) {
Expand Down