r
This commit is contained in:
+1
-2
@@ -180,8 +180,7 @@ abstract class Model extends Component implements ModelInterface, ArrayAccess, T
|
|||||||
*/
|
*/
|
||||||
public function getLastError(): string
|
public function getLastError(): string
|
||||||
{
|
{
|
||||||
$logger = Kiri::getDi()->get(LoggerInterface::class);
|
return Kiri::getLogger()->getLastError('mysql');
|
||||||
return $logger->getLastError('mysql');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -193,7 +193,7 @@ class Command extends Component
|
|||||||
if (!$client->inTransaction()) {
|
if (!$client->inTransaction()) {
|
||||||
$this->connection->release($client);
|
$this->connection->release($client);
|
||||||
}
|
}
|
||||||
return $result == 0 ? true : $result;
|
return $result == 0 ? true : (int)$result;
|
||||||
} catch (Throwable $throwable) {
|
} catch (Throwable $throwable) {
|
||||||
if (str_contains($throwable->getMessage(), 'MySQL server has gone away')) {
|
if (str_contains($throwable->getMessage(), 'MySQL server has gone away')) {
|
||||||
return $this->_execute();
|
return $this->_execute();
|
||||||
|
|||||||
Reference in New Issue
Block a user