This commit is contained in:
2021-03-05 16:36:18 +08:00
parent 41df099f4c
commit aa4127ed0e
4 changed files with 22 additions and 11 deletions
+12 -3
View File
@@ -463,10 +463,15 @@ class Server extends HttpService
{
$event = Snowflake::app()->getEvent();
$event->on(Event::SERVER_WORKER_START, function () {
$annotation = Snowflake::app()->getAttributes();
if (env('debug') !== 'true') {
return;
}
$router = Snowflake::app()->getRouter();
$router->loadRouterSetting();
annotation()->instanceDirectoryFiles(CONTROLLER_PATH);
$annotation->instanceDirectoryFiles(CONTROLLER_PATH);
$router->loadRouterSetting();
});
}
@@ -478,7 +483,11 @@ class Server extends HttpService
{
$event = Snowflake::app()->getEvent();
$event->on(Event::SERVER_WORKER_START, function () {
annotation()->instanceDirectoryFiles(SOCKET_PATH);
$annotation = Snowflake::app()->getAttributes();
if (env('debug') !== 'true') {
return;
}
$annotation->instanceDirectoryFiles(SOCKET_PATH);
});
}