改名
This commit is contained in:
@@ -35,11 +35,10 @@ class OnWorkerStart extends Callback
|
|||||||
putenv('state=start');
|
putenv('state=start');
|
||||||
putenv('worker=' . $worker_id);
|
putenv('worker=' . $worker_id);
|
||||||
|
|
||||||
$attribute = Snowflake::app()->getAttributes();
|
|
||||||
$attribute->read(directory('app'), 'App');
|
|
||||||
|
|
||||||
$this->set_process_name($server, $worker_id);
|
$this->set_process_name($server, $worker_id);
|
||||||
|
|
||||||
|
$this->loadDirectory();
|
||||||
|
|
||||||
if ($worker_id >= $server->setting['worker_num']) {
|
if ($worker_id >= $server->setting['worker_num']) {
|
||||||
$this->onTask($server, $worker_id);
|
$this->onTask($server, $worker_id);
|
||||||
} else {
|
} 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 Server $server
|
||||||
* @param int $worker_id
|
* @param int $worker_id
|
||||||
|
|||||||
@@ -412,7 +412,6 @@ class Server extends HttpService
|
|||||||
* @return Packet|Websocket|Receive|Http|null
|
* @return Packet|Websocket|Receive|Http|null
|
||||||
* @throws NotFindClassException
|
* @throws NotFindClassException
|
||||||
* @throws ReflectionException
|
* @throws ReflectionException
|
||||||
* @throws ComponentException
|
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
private function onListenerBind($config, $newListener): Packet|Websocket|Receive|Http|null
|
private function onListenerBind($config, $newListener): Packet|Websocket|Receive|Http|null
|
||||||
|
|||||||
+1
-1
@@ -633,7 +633,7 @@ if (!function_exists('env')) {
|
|||||||
* @param null $default
|
* @param null $default
|
||||||
* @return array|string|null
|
* @return array|string|null
|
||||||
*/
|
*/
|
||||||
function env($key, $default = null): null|array|string
|
#[Pure] function env($key, $default = null): null|array|string
|
||||||
{
|
{
|
||||||
$env = getenv($key);
|
$env = getenv($key);
|
||||||
if ($env === false) {
|
if ($env === false) {
|
||||||
|
|||||||
Reference in New Issue
Block a user