This commit is contained in:
2021-03-01 16:01:32 +08:00
parent a59e8dbeee
commit 1f828ad01d
4 changed files with 255 additions and 255 deletions
+2 -2
View File
@@ -317,8 +317,8 @@ class Connection extends Component
public function disconnect()
{
$connections = $this->connections();
$connections->disconnect($this->cds);
$connections->disconnect($this->slaveConfig['cds']);
$connections->disconnect($this->cds, true);
$connections->disconnect($this->slaveConfig['cds'], false);
}
}
+2 -1
View File
@@ -35,8 +35,9 @@ abstract class Callback extends HttpService
try {
fire(Event::SYSTEM_RESOURCE_CLEAN);
\logger()->insert();
Snowflake::clearProcessId($server->worker_pid);
Timer::clearAll();
$logger = Snowflake::app()->getLogger();
$logger->write($this->_MESSAGE[$message] . $worker_id);
+5 -4
View File
@@ -280,14 +280,15 @@ class Connection extends Pool
/**
* @param $coroutineName
* @param bool $isMaster
* @throws Exception
*/
public function disconnect($coroutineName)
public function disconnect($coroutineName, $isMaster = false)
{
if (!$this->hasClient($coroutineName)) {
return;
}
$coroutineName = $this->name($coroutineName, $isMaster);
if ($this->hasClient($coroutineName)) {
$this->remove($coroutineName);
}
$this->clean($coroutineName);
}
+2 -4
View File
@@ -104,13 +104,11 @@ class Redis extends Pool
{
$name = $config['host'] . ':' . $config['prefix'] . ':' . $config['databases'];
$coroutineName = $this->name('redis', 'redis:' . $name, $isMaster);
if (!Context::hasContext($coroutineName)) {
return;
}
if (Context::hasContext($coroutineName)) {
$this->desc($coroutineName);
$this->remove($coroutineName);
}
$this->clean($coroutineName);
}