eee
This commit is contained in:
+21
-3
@@ -188,15 +188,33 @@ class Command extends Component
|
||||
*/
|
||||
protected function isRefresh(Throwable $throwable): bool
|
||||
{
|
||||
if (str_contains($throwable->getMessage(), 'MySQL server has gone away')) {
|
||||
$message = $throwable->getMessage();
|
||||
|
||||
// MySQL 错误处理
|
||||
if (str_contains($message, 'MySQL server has gone away')) {
|
||||
return true;
|
||||
}
|
||||
if (str_contains($throwable->getMessage(), 'Send of 14 bytes failed with errno=32 Broken pipe')) {
|
||||
if (str_contains($message, 'Send of 14 bytes failed with errno=32 Broken pipe')) {
|
||||
return true;
|
||||
}
|
||||
if (str_contains($throwable->getMessage(), 'Lost connection to MySQL server during query')) {
|
||||
if (str_contains($message, 'Lost connection to MySQL server during query')) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// PostgreSQL 错误处理
|
||||
if (str_contains($message, 'server closed the connection unexpectedly')) {
|
||||
return true;
|
||||
}
|
||||
if (str_contains($message, 'Connection refused')) {
|
||||
return true;
|
||||
}
|
||||
if (str_contains($message, 'Broken pipe')) {
|
||||
return true;
|
||||
}
|
||||
if (str_contains($message, 'connection to server was lost')) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user