Merge branch 'master' of https://gitee.com/dreamwithouttrace/snowflake into v1.0
This commit is contained in:
@@ -92,7 +92,7 @@ if (_nx ~= 0) then
|
|||||||
end
|
end
|
||||||
return 0
|
return 0
|
||||||
SCRIPT;
|
SCRIPT;
|
||||||
return $this->proxy()->eval($script, [$key, $timeout], 1);
|
return $this->proxy()->eval($script, ['{lock}:' . $key, $timeout], 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -104,7 +104,7 @@ SCRIPT;
|
|||||||
public function unlock($key): int
|
public function unlock($key): int
|
||||||
{
|
{
|
||||||
$redis = $this->proxy();
|
$redis = $this->proxy();
|
||||||
return $redis->del($key);
|
return $redis->del('{lock}:' . $key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -184,6 +184,19 @@ abstract class Crontab extends BaseObject
|
|||||||
abstract public function isStop(): bool;
|
abstract public function isStop(): bool;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param $name
|
||||||
|
* @return mixed
|
||||||
|
*/
|
||||||
|
public function __get($name): mixed
|
||||||
|
{
|
||||||
|
if (!isset($this->params[$name])) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return $this->params[$name];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user