Skip to content

Commit 8b254ed

Browse files
author
Willem Stuursma-Ruwen
authored
Merge pull request #41 from mvorisek/better_lock_random
Better RedLock token
2 parents a452926 + a9396a8 commit 8b254ed

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

classes/mutex/RedisMutex.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ protected function acquire(string $key, int $expire): bool
7676
// 2.
7777
$acquired = 0;
7878
$errored = 0;
79-
$this->token = random_bytes(16);
79+
$this->token = bin2hex(random_bytes(16));
8080
$exception = null;
8181
foreach ($this->redisAPIs as $index => $redisAPI) {
8282
try {

0 commit comments

Comments
 (0)