This commit is contained in:
as2252258@163.com
2021-03-01 01:02:34 +08:00
parent f6e612cba3
commit 71152bdd1a
2 changed files with 34 additions and 22 deletions
-22
View File
@@ -44,29 +44,7 @@ class OnManagerStart extends Callback
return;
}
name(Config::get('id', false, 'system') . ' Server Manager.');
Coroutine\go([$this, 'onSignal'], $server);
}
/**
* @param $server
* @param $worker_id
*/
public function onSignal($server)
{
$receive = Coroutine::waitSignal($this->signal, 30);
while ($receive === true) {
if ($this->isPrint === false) {
$this->warning(sprintf('Receive Worker stop event.'));
$this->isPrint = true;
}
if (!Snowflake::app()->isRun()) {
break;
}
sleep(1);
}
return $server->stop();
}
}