Index: trunk/extensions/OnlineStatusBar/OnlineStatusBar.status.php |
— | — | @@ -24,12 +24,18 @@ |
25 | 25 | global $wgOnlineStatusBarDefaultOffline, $wgOnlineStatusBarDefaultOnline; |
26 | 26 | |
27 | 27 | // instead of delete every time just select the records which are not that old |
28 | | - $t_time = OnlineStatusBar::getTimeoutDate(); |
29 | 28 | $dbr = wfGetDB( DB_SLAVE ); |
30 | | - $w_time = OnlineStatusBar::getTimeoutDate( true ); |
31 | | - $result = $dbr->selectField( 'online_status', 'timestamp', array( 'username' => $user->getName(), |
32 | | - "timestamp > " . $dbr->addQuotes( $dbr->timestamp( $t_time ) ) ), |
33 | | - __METHOD__, array( 'LIMIT 1', 'ORDER BY timestamp DESC' ) ); |
| 29 | + if ( !$delayed_check ) { |
| 30 | + $t_time = OnlineStatusBar::getTimeoutDate(); |
| 31 | + $result = $dbr->selectField( 'online_status', 'timestamp', array( 'username' => $user->getName(), |
| 32 | + "timestamp > " . $dbr->addQuotes( $dbr->timestamp( $t_time ) ) ), |
| 33 | + __METHOD__, array( 'LIMIT 1', 'ORDER BY timestamp DESC' ) ); |
| 34 | + } |
| 35 | + else { |
| 36 | + $result = $dbr->selectField( 'online_status', 'timestamp', array( 'username' => $user->getName() ), |
| 37 | + __METHOD__, array( 'LIMIT 1', 'ORDER BY timestamp DESC' ) ); |
| 38 | + $w_time = OnlineStatusBar::getTimeoutDate( true ); |
| 39 | + } |
34 | 40 | |
35 | 41 | if ( $result === false ) { |
36 | 42 | $status = $wgOnlineStatusBarDefaultOffline; |
— | — | @@ -70,7 +76,7 @@ |
71 | 77 | 'username' => $wgUser->getName(), |
72 | 78 | 'timestamp' => $dbw->timestamp(), |
73 | 79 | ); |
74 | | - $dbw->insert( 'online_status', $row, __METHOD__, 'DELAYED' ); |
| 80 | + $dbw->insert( 'online_status', $row, __METHOD__ ); |
75 | 81 | return false; |
76 | 82 | } |
77 | 83 | |