first commit
This commit is contained in:
35
vendor/laravel/framework/src/Illuminate/Cache/PhpRedisLock.php
vendored
Normal file
35
vendor/laravel/framework/src/Illuminate/Cache/PhpRedisLock.php
vendored
Normal file
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace Illuminate\Cache;
|
||||
|
||||
use Illuminate\Redis\Connections\PhpRedisConnection;
|
||||
|
||||
class PhpRedisLock extends RedisLock
|
||||
{
|
||||
/**
|
||||
* Create a new phpredis lock instance.
|
||||
*
|
||||
* @param \Illuminate\Redis\Connections\PhpRedisConnection $redis
|
||||
* @param string $name
|
||||
* @param int $seconds
|
||||
* @param string|null $owner
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(PhpRedisConnection $redis, string $name, int $seconds, ?string $owner = null)
|
||||
{
|
||||
parent::__construct($redis, $name, $seconds, $owner);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function release()
|
||||
{
|
||||
return (bool) $this->redis->eval(
|
||||
LuaScripts::releaseLock(),
|
||||
1,
|
||||
$this->name,
|
||||
...$this->redis->pack([$this->owner])
|
||||
);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user