This commit is contained in:
2021-01-19 17:59:31 +08:00
parent 31ad3d568c
commit 18762e988a
2 changed files with 8 additions and 0 deletions
+7
View File
@@ -4,6 +4,7 @@ declare(strict_types=1);
namespace Database;
use Annotation\IAnnotation;
use Exception;
use Snowflake\Abstracts\Providers;
use Snowflake\Application;
@@ -31,6 +32,12 @@ class DatabasesProviders extends Providers
$event = Snowflake::app()->getEvent();
$event->on(Event::SERVER_WORKER_START, [$this, 'createPool']);
$event->on(Event::SERVER_TASK_START, [$this, 'createPool']);
$event = Snowflake::app()->getEvent();
$event->on(Event::SERVER_WORKER_START, function () {
$attributes = Snowflake::app()->getAttributes();
$attributes->readControllers(CONTROLLER_PATH, 'App\Models', 'models');
});
}