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);