This commit is contained in:
2021-03-05 16:57:12 +08:00
parent 2fedf6dd88
commit 4c49bbbdd0
5 changed files with 24 additions and 7 deletions
+3 -2
View File
@@ -36,8 +36,9 @@ class OnWorkerStart extends Callback
putenv('state=start');
putenv('worker=' . $worker_id);
if (env('debug') === 'true') {
annotation()->read(APP_PATH . 'app', 'App');
if (env('debug', 'false') == 'true') {
$attribute = Snowflake::app()->getAttributes();
$attribute->read(directory('app'), 'App');
}
if ($worker_id >= $server->setting['worker_num']) {
+2 -2
View File
@@ -464,7 +464,7 @@ class Server extends HttpService
$event = Snowflake::app()->getEvent();
$event->on(Event::SERVER_WORKER_START, function () {
$annotation = Snowflake::app()->getAttributes();
if (env('debug') !== 'true') {
if (env('debug') != 'true') {
return;
}
$router = Snowflake::app()->getRouter();
@@ -484,7 +484,7 @@ class Server extends HttpService
$event = Snowflake::app()->getEvent();
$event->on(Event::SERVER_WORKER_START, function () {
$annotation = Snowflake::app()->getAttributes();
if (env('debug') !== 'true') {
if (env('debug') != 'true') {
return;
}
$annotation->instanceDirectoryFiles(SOCKET_PATH);