"Changes newer than 1 seconds may not be shown in this list." is kind of ridiculous...
authorRiver Tarnell <river@users.mediawiki.org>
Mon, 21 May 2007 23:21:29 +0000 (23:21 +0000)
committerRiver Tarnell <river@users.mediawiki.org>
Mon, 21 May 2007 23:21:29 +0000 (23:21 +0000)
includes/DefaultSettings.php
includes/OutputPage.php

index e2074b7..ad685ad 100644 (file)
@@ -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;
+
 ?>
index 458907f..384e803 100644 (file)
@@ -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( "<div class=\"mw-{$message}\">\n{$warning}\n</div>\n" );
        }
        
 }
 
-?>
\ No newline at end of file
+?>