diff --git a/src/RedLock.php b/src/RedLock.php index 201feaf..0a085d4 100644 --- a/src/RedLock.php +++ b/src/RedLock.php @@ -26,7 +26,7 @@ public function lock($resource, $ttl) { $this->initInstances(); - $token = uniqid(); + $token = $this->generateToken(); $retry = $this->retryCount; do { @@ -82,6 +82,10 @@ public function unlock($lock) } } + protected function generateToken() { + return uniqid(); + } + private function initInstances() { if (empty($this->instances)) {