This commit is contained in:
2023-08-14 12:41:16 +08:00
parent 3d0fd3d5d0
commit 63ddc36958
+2
View File
@@ -113,6 +113,8 @@ class Connection extends Component
]; ];
if (!Context::inCoroutine()) { if (!Context::inCoroutine()) {
$options[PDO::ATTR_PERSISTENT] = true; $options[PDO::ATTR_PERSISTENT] = true;
} else {
$options[PDO::ATTR_PERSISTENT] = false;
} }
$link = new PDO('mysql:dbname=' . $config['dbname'] . ';host=' . $config['cds'], $link = new PDO('mysql:dbname=' . $config['dbname'] . ';host=' . $config['cds'],
$config['username'], $config['password'], $options); $config['username'], $config['password'], $options);