This commit is contained in:
2021-02-23 17:30:10 +08:00
parent 31d5024663
commit 5e2cf4db18
6 changed files with 33 additions and 4 deletions
+4 -1
View File
@@ -6,6 +6,7 @@ namespace Snowflake\Pool;
use Exception;
use ReflectionException;
use Snowflake\Event;
use Snowflake\Exception\NotFindClassException;
use Snowflake\Snowflake;
@@ -37,7 +38,9 @@ class ObjectPool extends \Snowflake\Abstracts\Pool
if (is_object($config)) {
return $config;
}
return $this->getFromChannel(md5($config), [$config, $construct]);
$object = $this->getFromChannel(md5($config), [$config, $construct]);
listen(Event::EVENT_AFTER_REQUEST, [$object, 'clean']);
return $object;
}