@@ -106,22 +106,22 @@ protected function acquire($key, $expire)
106
106
if ($ isAcquired ) {
107
107
// 4.
108
108
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
+ }
122
110
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
+ );
124
122
}
123
+
124
+ return false ;
125
125
}
126
126
127
127
/**
@@ -193,7 +193,7 @@ abstract protected function add($redisAPI, $key, $value, $expire);
193
193
/**
194
194
* @param mixed $redisAPI The connected Redis API.
195
195
* @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.
197
197
* @param array $arguments Keys and values.
198
198
*
199
199
* @return mixed The script result, or false if executing failed.
0 commit comments