Index: trunk/extensions/OnlineStatusBar/OnlineStatusBar.status.php |
— | — | @@ -83,14 +83,16 @@ |
84 | 84 | } else { |
85 | 85 | // checking only if we need to do write or not |
86 | 86 | $result = self::getCache( $user->getName(), ONLINESTATUSBAR_DELAYED_CACHE ); |
| 87 | + $w_time = OnlineStatusBar::getTimeoutDate( ONLINESTATUSBAR_CK_DELAYED ); |
87 | 88 | if ( $result == '' ) { |
88 | 89 | $dbr = wfGetDB( DB_SLAVE ); |
89 | 90 | $result = $dbr->selectField( 'online_status', 'timestamp', array( 'username' => $user->getName() ), |
90 | 91 | __METHOD__, array( 'LIMIT 1', 'ORDER BY timestamp DESC' ) ); |
91 | 92 | // cache it |
92 | | - self::setCache( $user->getName(), $result, ONLINESTATUSBAR_DELAYED_CACHE ); |
| 93 | + if ( $result !== false && $result > wfTimestamp( TS_MW, $w_time ) ) { |
| 94 | + self::setCache( $user->getName(), $result, ONLINESTATUSBAR_DELAYED_CACHE ); |
| 95 | + } |
93 | 96 | } |
94 | | - $w_time = OnlineStatusBar::getTimeoutDate( ONLINESTATUSBAR_CK_DELAYED ); |
95 | 97 | } |
96 | 98 | |
97 | 99 | if ( $result === false ) { |