We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2017397 commit 2d3773cCopy full SHA for 2d3773c
src/DatabaseManager.php
@@ -5,7 +5,8 @@
5
use Illuminate\Database\DatabaseManager as BaseDatabaseManager;
6
use Throwable;
7
use Webman\Context;
8
-use Webman\Coroutine\Pool;
+use Workerman\Coroutine\Coroutine;
9
+use Workerman\Coroutine\Pool;
10
11
/**
12
* Class DatabaseManager
@@ -51,7 +52,7 @@ public function connection($name = null)
51
52
$connection = static::$pools[$name]->get();
53
Context::set($key, $connection);
54
} finally {
- Context::onDestroy(function () use ($connection, $name) {
55
+ Coroutine::defer(function () use ($connection, $name) {
56
try {
57
$connection && static::$pools[$name]->put($connection);
58
} catch (Throwable) {
0 commit comments