Move up devunt's name to Developers
[lhc/web/wiklou.git] / includes / db / LoadMonitor.php
index b694a6f..3d853cb 100644 (file)
@@ -93,8 +93,6 @@ class LoadMonitorMySQL implements LoadMonitor {
                        return array( 0 => 0 );
                }
 
-               $section = new ProfileSection( __METHOD__ );
-
                $expiry = 5;
                $requestRate = 10;
 
@@ -117,10 +115,10 @@ class LoadMonitorMySQL implements LoadMonitor {
                }
 
                # Cache key missing or expired
-               if ( $cache->add( "$memcKey:lock", 1, 10 ) ) {
+               if ( $cache->lock( $memcKey, 0, 10 ) ) {
                        # Let this process alone update the cache value
                        $unlocker = new ScopedCallback( function () use ( $cache, $memcKey ) {
-                               $cache->delete( $memcKey );
+                               $cache->unlock( $memcKey );
                        } );
                } elseif ( is_array( $times ) ) {
                        # Could not acquire lock but an old cache exists, so use it