*/
$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;
+
?>
* @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( "<div class=\"mw-{$message}\">\n{$warning}\n</div>\n" );
}
}
-?>
\ No newline at end of file
+?>