From 9b331798fbe78ed9566d73e2cd42c9f6df41e7d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=91=E6=9E=97?= Date: Mon, 3 Apr 2023 00:24:51 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=98=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- kiri-engine/Pool/Connection.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/kiri-engine/Pool/Connection.php b/kiri-engine/Pool/Connection.php index 69bd8f0f..eb19cf3c 100644 --- a/kiri-engine/Pool/Connection.php +++ b/kiri-engine/Pool/Connection.php @@ -154,7 +154,10 @@ class Connection extends Component { return function () use ($config) { if ($this->total >= 300) { - return $this->pool->waite($config['cds'], 30); + $connect = $this->pool->waite($config['cds'], 30); + if ($connect === false) { + throw new Exception("Get database link wait timeout."); + } } $this->total += 1; return new \Database\Mysql\PDO($config);