Lowered high lock timeout in mergeViaLock() and lock() in BagOStuff
authorAaron Schulz <aschulz@wikimedia.org>
Tue, 18 Mar 2014 17:16:58 +0000 (10:16 -0700)
committerOri.livneh <ori@wikimedia.org>
Tue, 25 Mar 2014 17:14:33 +0000 (17:14 +0000)
Change-Id: Ib5cd0a98ce6ec47edb24f8cc9f4df2c941ce1c38

includes/objectcache/BagOStuff.php

index 4a27692..217142c 100644 (file)
@@ -142,7 +142,7 @@ abstract class BagOStuff {
         * @return bool success
         */
        protected function mergeViaLock( $key, closure $callback, $exptime = 0, $attempts = 10 ) {
-               if ( !$this->lock( $key, 60 ) ) {
+               if ( !$this->lock( $key, 6 ) ) {
                        return false;
                }
 
@@ -168,7 +168,7 @@ abstract class BagOStuff {
         * @param $timeout integer [optional]
         * @return bool success
         */
-       public function lock( $key, $timeout = 60 ) {
+       public function lock( $key, $timeout = 6 ) {
                $timestamp = microtime( true ); // starting UNIX timestamp
                if ( $this->add( "{$key}:lock", 1, $timeout ) ) {
                        return true;