Skip to content

Commit

Permalink
Merge pull request #9 from joni2back/patch-1
Browse files Browse the repository at this point in the history
fix typo
  • Loading branch information
ronnylt committed Mar 6, 2015
2 parents 4066b30 + ae2f760 commit 7f75de4
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/RedLock.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ function __construct(array $servers, $retryDelay = 200, $retryCount = 3)
$this->retryCount = $retryCount;

$this->quorum = min(count($servers), (count($servers) / 2 + 1));

}

public function lock($resource, $ttl)
Expand Down Expand Up @@ -71,7 +70,7 @@ public function lock($resource, $ttl)
return false;
}

public function unlock($lock)
public function unlock(array $lock)
{
$this->initInstances();
$resource = $lock['resource'];
Expand All @@ -98,7 +97,6 @@ private function initInstances()
private function lockInstance($instance, $resource, $token, $ttl)
{
return $instance->set($resource, $token, ['NX', 'PX' => $ttl]);

}

private function unlockInstance($instance, $resource, $token)
Expand All @@ -109,9 +107,7 @@ private function unlockInstance($instance, $resource, $token)
else
return 0
end
';


';
return $instance->eval($script, [$resource, $token], 1);
}
}

0 comments on commit 7f75de4

Please sign in to comment.