改名
This commit is contained in:
@@ -67,13 +67,13 @@ class Redis implements StopHeartbeatCheck
|
|||||||
*/
|
*/
|
||||||
public function heartbeat_check(): void
|
public function heartbeat_check(): void
|
||||||
{
|
{
|
||||||
if (env('state','start') == 'exit') {
|
if (env('state', 'start') == 'exit') {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if ($this->_timer === -1 && Context::inCoroutine()) {
|
if ($this->_timer === -1 && Context::inCoroutine()) {
|
||||||
$this->_timer = Timer::tick(1000, function () {
|
$this->_timer = Timer::tick(1000, function () {
|
||||||
try {
|
try {
|
||||||
if (env('state','start') == 'exit') {
|
if (env('state', 'start') == 'exit') {
|
||||||
Kiri::getDi()->get(Logger::class)->critical('timer end');
|
Kiri::getDi()->get(Logger::class)->critical('timer end');
|
||||||
$this->stopHeartbeatCheck();
|
$this->stopHeartbeatCheck();
|
||||||
}
|
}
|
||||||
@@ -150,7 +150,9 @@ class Redis implements StopHeartbeatCheck
|
|||||||
$this->read_timeout = 0;
|
$this->read_timeout = 0;
|
||||||
}
|
}
|
||||||
$redis->select($this->database);
|
$redis->select($this->database);
|
||||||
|
if ($this->read_timeout > 0) {
|
||||||
$redis->setOption(\Redis::OPT_READ_TIMEOUT, $this->read_timeout);
|
$redis->setOption(\Redis::OPT_READ_TIMEOUT, $this->read_timeout);
|
||||||
|
}
|
||||||
$redis->setOption(\Redis::OPT_PREFIX, $this->prefix);
|
$redis->setOption(\Redis::OPT_PREFIX, $this->prefix);
|
||||||
return $redis;
|
return $redis;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user