Skip to content

Commit a98afa2

Browse files
committed
Improve RedisMutex token randomness
1 parent 7d84358 commit a98afa2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/mutex/RedisMutex.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ protected function acquire(string $key, float $expire): bool
5050
// 2.
5151
$acquired = 0;
5252
$errored = 0;
53-
$this->token = bin2hex(random_bytes(16));
53+
$this->token = bin2hex(random_bytes(16)) . md5((string) $time);
5454
$exception = null;
5555
foreach ($this->redisAPIs as $index => $redisAPI) {
5656
try {

0 commit comments

Comments
 (0)