This commit is contained in:
2021-03-29 16:27:12 +08:00
parent c1d37ce826
commit 4442397aa9
10 changed files with 25 additions and 16 deletions
+2 -1
View File
@@ -11,6 +11,7 @@ declare(strict_types=1);
namespace Database;
use Annotation\Aspect;
use JetBrains\PhpStorm\Pure;
use ReflectionException;
use Snowflake\Abstracts\Component;
@@ -66,7 +67,7 @@ class Connection extends Component
/**
* @throws Exception
*/
public function init()
#[Aspect(InjectProperty::class)] public function init()
{
$event = Snowflake::app()->getEvent();
$event->on(Event::SYSTEM_RESOURCE_CLEAN, [$this, 'disconnect']);