From: River Tarnell Date: Mon, 21 May 2007 23:21:29 +0000 (+0000) Subject: "Changes newer than 1 seconds may not be shown in this list." is kind of ridiculous... X-Git-Tag: 1.31.0-rc.0~52834 X-Git-Url: http://git.cyclocoop.org/%24image?a=commitdiff_plain;h=f5ea63185cfff3648f06febe812cab34a722c050;p=lhc%2Fweb%2Fwiklou.git "Changes newer than 1 seconds may not be shown in this list." is kind of ridiculous. make the warning and "more obvious warning" thresholds configurable, default 15 resp. 30 seconds. --- diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index e2074b7da0..ad685ad1b8 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -2562,4 +2562,12 @@ $wgEnableCascadingProtection = true; */ $wgDisableOutputCompression = false; +/** + * If lag is higher than $wgSlaveLagWarning, show a warning in some special + * pages (like watchlist). If the lag is higher than $wgSlaveLagOhNo, show a + * more obvious warning. + */ +$wgSlaveLagWarning = 10; +$wgSlaveLagOhNo = 30; + ?> diff --git a/includes/OutputPage.php b/includes/OutputPage.php index 458907fbfd..384e803388 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -1246,11 +1246,16 @@ class OutputPage { * @param int $lag Slave lag */ public function showLagWarning( $lag ) { - $message = $lag >= 30 ? 'lag-warn-high' : 'lag-warn-normal'; + global $wgSlaveLagWarning, $wgSlaveLagOhNo; + + if ($lag < $wgSlaveLagWarning) + return; + + $message = $lag >= $wgSlaveLagOhNo ? 'lag-warn-high' : 'lag-warn-normal'; $warning = wfMsgHtml( $message, htmlspecialchars( $lag ) ); $this->addHtml( "
\n{$warning}\n
\n" ); } } -?> \ No newline at end of file +?>