@@ -106,22 +106,22 @@ protected function acquire($key, $expire)
106106 if ($ isAcquired ) {
107107 // 4.
108108 return true ;
109- } else {
110- // 5.
111- $ this ->release ($ key );
112-
113- // In addition to RedLock it's an exception if too many servers fail.
114- if (!$ this ->isMajority (count ($ this ->redisAPIs ) - $ errored )) {
115- assert (!is_null ($ exception )); // The last exception for some context.
116- throw new LockAcquireException (
117- "It's not possible to acquire a lock because at least half of the Redis server are not available. " ,
118- LockAcquireException::REDIS_NOT_ENOUGH_SERVERS ,
119- $ exception
120- );
121- }
109+ }
122110
123- return false ;
111+ // 5.
112+ $ this ->release ($ key );
113+
114+ // In addition to RedLock it's an exception if too many servers fail.
115+ if (!$ this ->isMajority (count ($ this ->redisAPIs ) - $ errored )) {
116+ assert (!is_null ($ exception )); // The last exception for some context.
117+ throw new LockAcquireException (
118+ "It's not possible to acquire a lock because at least half of the Redis server are not available. " ,
119+ LockAcquireException::REDIS_NOT_ENOUGH_SERVERS ,
120+ $ exception
121+ );
124122 }
123+
124+ return false ;
125125 }
126126
127127 /**
@@ -193,7 +193,7 @@ abstract protected function add($redisAPI, $key, $value, $expire);
193193 /**
194194 * @param mixed $redisAPI The connected Redis API.
195195 * @param string $script The Lua script.
196- * @param int $numkeys The number of arguments that represent Redis key names.
196+ * @param int $numkeys The number of values in $ arguments that represent Redis key names.
197197 * @param array $arguments Keys and values.
198198 *
199199 * @return mixed The script result, or false if executing failed.
0 commit comments