Skip to content
Permalink
Browse files

formatting and fixes

  • Loading branch information
taylorotwell committed Jan 21, 2020
1 parent c2b7178 commit 8683a3d721f92e512a83a3e5feb3d0a9bb682560
Showing with 2 additions and 7 deletions.
  1. +2 −7 src/Illuminate/Cache/RedisLock.php
@@ -35,14 +35,9 @@ public function __construct($redis, $name, $seconds, $owner = null)
public function acquire()
{
if ($this->seconds > 0) {
// Use the atomic operations EX NX to avoid deadlock (Redis version >= 2.6.12)
$result = $this->redis->set($this->name, $this->owner, 'EX', $this->seconds, 'NX');

return $result == 'OK';
return $this->redis->set($this->name, $this->owner, 'EX', $this->seconds, 'NX') == true;
} else {
$result = $this->redis->setnx($this->name, $this->owner);

return $result === 1;
return $this->redis->setnx($this->name, $this->owner) === 1;
}
}

0 comments on commit 8683a3d

Please sign in to comment.
You can’t perform that action at this time.