From f5ea63185cfff3648f06febe812cab34a722c050 Mon Sep 17 00:00:00 2001 From: River Tarnell Date: Mon, 21 May 2007 23:21:29 +0000 Subject: [PATCH] "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. --- includes/DefaultSettings.php | 8 ++++++++ includes/OutputPage.php | 9 +++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) 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 +?> -- 2.20.1