diff --git a/src/Traits/ManagesLocksAndShardsTrait.php b/src/Traits/ManagesLocksAndShardsTrait.php index 58f0804..ea778d7 100644 --- a/src/Traits/ManagesLocksAndShardsTrait.php +++ b/src/Traits/ManagesLocksAndShardsTrait.php @@ -12,7 +12,7 @@ protected function acquireLock(string $key, ?string $connection_name = null): bo $lockKey = 'lock:' . $key; // Tenta di acquisire il lock con un timeout di 10 secondi //return $this->redis->getRedisConnection($connection_name)->set($lockKey, '1', 'NX', 'EX', 10); - return $this->redis->getRedisConnection($connection_name)->set($key, 1, 'NX', 'EX', 10); + return $this->redis->getRedisConnection($connection_name)->set($key, 1, 'EX', 10, 'NX'); } /**