mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-06 23:02:48 +08:00
改进mysql重连判断
This commit is contained in:
@@ -138,8 +138,13 @@ class Mysql extends Connection
|
|||||||
*/
|
*/
|
||||||
protected function isBreak($e)
|
protected function isBreak($e)
|
||||||
{
|
{
|
||||||
if (false !== stripos($e->getMessage(), 'server has gone away')) {
|
$info = ['server has gone away', 'Error while sending STMT_'];
|
||||||
return true;
|
$error = $e->getMessage();
|
||||||
|
|
||||||
|
foreach ($info as $msg) {
|
||||||
|
if (false !== stripos($error, $msg)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user