Index: trunk/phase3/includes/User.php |
— | — | @@ -1283,6 +1283,7 @@ |
1284 | 1284 | list( $max, $period ) = $limit; |
1285 | 1285 | $summary = "(limit $max in {$period}s)"; |
1286 | 1286 | $count = $wgMemc->get( $key ); |
| 1287 | + // Already pinged? |
1287 | 1288 | if( $count ) { |
1288 | 1289 | if( $count > $max ) { |
1289 | 1290 | wfDebug( __METHOD__ . ": tripped! $key at $count $summary\n" ); |
— | — | @@ -1293,11 +1294,11 @@ |
1294 | 1295 | } else { |
1295 | 1296 | wfDebug( __METHOD__ . ": ok. $key at $count $summary\n" ); |
1296 | 1297 | } |
| 1298 | + $wgMemc->incr( $key ); |
1297 | 1299 | } else { |
1298 | 1300 | wfDebug( __METHOD__ . ": adding record for $key $summary\n" ); |
1299 | | - $wgMemc->add( $key, 1, intval( $period ) ); |
| 1301 | + $wgMemc->set( $key, 1, intval( $period ) ); // first ping |
1300 | 1302 | } |
1301 | | - $wgMemc->incr( $key ); |
1302 | 1303 | } |
1303 | 1304 | |
1304 | 1305 | wfProfileOut( __METHOD__ ); |