Fixed r57659 for high concurrency situations
authorAaron Schulz <aaron@users.mediawiki.org>
Mon, 21 Dec 2009 17:51:10 +0000 (17:51 +0000)
committerAaron Schulz <aaron@users.mediawiki.org>
Mon, 21 Dec 2009 17:51:10 +0000 (17:51 +0000)
includes/User.php

index 2f2c631..f9ab4f0 100644 (file)
@@ -1340,11 +1340,11 @@ class User {
                                } else {
                                        wfDebug( __METHOD__ . ": ok. $key at $count $summary\n" );
                                }
-                               $wgMemc->incr( $key );
                        } else {
                                wfDebug( __METHOD__ . ": adding record for $key $summary\n" );
-                               $wgMemc->set( $key, 1, intval( $period ) ); // first ping
+                               $wgMemc->add( $key, 0, intval( $period ) ); // first ping
                        }
+                       $wgMemc->incr( $key );
                }
 
                wfProfileOut( __METHOD__ );