r103832 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r103831‎ | r103832 | r103833 >
Date:20:55, 21 November 2011
Author:petrb
Status:deferred
Tags:
Comment:
use shorter names for type and small fixes (I don't think it's necessary for key to be that long and it save some data transfer)
Modified paths:
  • /trunk/extensions/OnlineStatusBar/OnlineStatusBar.status.php (modified) (history)

Diff [purge]

Index: trunk/extensions/OnlineStatusBar/OnlineStatusBar.status.php
@@ -47,13 +47,13 @@
4848 * @return String
4949 */
5050 public static function getStatus( $user, $delayed_check = false ) {
51 - global $wgOnlineStatusBarDefaultOffline, $wgMemc, $wgOnlineStatusBarDefaultOnline;
 51+ global $wgOnlineStatusBarDefaultOffline, $wgOnlineStatusBarDefaultOnline;
5252
5353 // instead of delete every time just select the records which are not that old
5454 if ( !$delayed_check ) {
5555 $t_time = OnlineStatusBar::getTimeoutDate();
5656 // first try to use cache
57 - $result = self::getCache( $user->getName(), "delayed" );
 57+ $result = self::getCache( $user->getName(), "n" );
5858
5959 if ( $result == '' ) {
6060 $dbr = wfGetDB( DB_SLAVE );
@@ -61,11 +61,11 @@
6262 "timestamp > " . $dbr->addQuotes( $dbr->timestamp( $t_time ) ) ),
6363 __METHOD__, array( 'LIMIT 1', 'ORDER BY timestamp DESC' ) );
6464 // cache it
65 - self::setCache( $user->getName(), $result, "delayed" );
 65+ self::setCache( $user->getName(), $result, "n" );
6666 }
6767 }
6868 else {
69 - $result = self::getCache( $user->getName(), "normal" );
 69+ $result = self::getCache( $user->getName(), "d" );
7070
7171 if ( $result == '' ) {
7272 $dbr = wfGetDB( DB_SLAVE );
@@ -73,7 +73,7 @@
7474 __METHOD__, array( 'LIMIT 1', 'ORDER BY timestamp DESC' ) );
7575 $w_time = OnlineStatusBar::getTimeoutDate( true );
7676 // cache it
77 - self::setCache( $user->getName(), $result, "normal" );
 77+ self::setCache( $user->getName(), $result, "d" );
7878 }
7979 }
8080

Status & tagging log