Skip to content

Commit

Permalink
Improve RedisMutex token randomness
Browse files Browse the repository at this point in the history
  • Loading branch information
mvorisek committed Dec 5, 2024
1 parent 7d84358 commit a98afa2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/mutex/RedisMutex.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ protected function acquire(string $key, float $expire): bool
// 2.
$acquired = 0;
$errored = 0;
$this->token = bin2hex(random_bytes(16));
$this->token = bin2hex(random_bytes(16)) . md5((string) $time);
$exception = null;
foreach ($this->redisAPIs as $index => $redisAPI) {
try {
Expand Down

0 comments on commit a98afa2

Please sign in to comment.