This commit is contained in:
2021-03-23 19:19:16 +08:00
parent 1d265d6f7f
commit bdbd91d8ab
3 changed files with 16 additions and 5 deletions
+15 -3
View File
@@ -35,11 +35,10 @@ class OnWorkerStart extends Callback
putenv('state=start');
putenv('worker=' . $worker_id);
$attribute = Snowflake::app()->getAttributes();
$attribute->read(directory('app'), 'App');
$this->set_process_name($server, $worker_id);
$this->loadDirectory();
if ($worker_id >= $server->setting['worker_num']) {
$this->onTask($server, $worker_id);
} else {
@@ -48,6 +47,19 @@ class OnWorkerStart extends Callback
}
/**
* @throws Exception
*/
private function loadDirectory()
{
if (env('debug','true') === 'false') {
return;
}
$attribute = Snowflake::app()->getAttributes();
$attribute->read(directory('app'), 'App');
}
/**
* @param Server $server
* @param int $worker_id
-1
View File
@@ -412,7 +412,6 @@ class Server extends HttpService
* @return Packet|Websocket|Receive|Http|null
* @throws NotFindClassException
* @throws ReflectionException
* @throws ComponentException
* @throws Exception
*/
private function onListenerBind($config, $newListener): Packet|Websocket|Receive|Http|null