This commit is contained in:
as2252258@163.com
2021-09-06 02:21:56 +08:00
parent 6386b2c8a9
commit 7ae222268e
2 changed files with 5 additions and 7 deletions
+3 -5
View File
@@ -48,11 +48,9 @@ class Pool extends Component
protected function pop(Channel $channel, $retain_number): void
{
while ($channel->length() > $retain_number) {
if (Context::inCoroutine()) {
$connection = $channel->pop();
if ($connection instanceof StopHeartbeatCheck) {
$connection->stopHeartbeatCheck();
}
$connection = $channel->pop();
if ($connection instanceof StopHeartbeatCheck) {
$connection->stopHeartbeatCheck();
}
}
}
+2 -2
View File
@@ -83,9 +83,9 @@ class OnServerWorker extends \Server\Abstracts\Server
*/
public function onWorkerExit(Server $server, int $workerId)
{
$this->eventDispatch->dispatch(new OnWorkerExit($server, $workerId));
ServerManager::setEnv('state', 'exit');
$this->eventDispatch->dispatch(new OnWorkerExit($server, $workerId));
}