Merge "Fixed getLagTimes() locking"
This commit is contained in:
commit
9492e5bd2a
2 changed files with 3 additions and 3 deletions
|
|
@ -115,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
|
||||
|
|
|
|||
|
|
@ -205,7 +205,7 @@ abstract class BagOStuff implements LoggerAwareInterface {
|
|||
|
||||
/**
|
||||
* @param string $key
|
||||
* @param int $timeout Lock wait timeout [optional]
|
||||
* @param int $timeout Lock wait timeout; 0 for non-blocking [optional]
|
||||
* @param int $expiry Lock expiry [optional]
|
||||
* @return bool Success
|
||||
*/
|
||||
|
|
|
|||
Loading…
Reference in a new issue