This commit is contained in:
2025-12-31 00:19:31 +08:00
parent 87e7535f27
commit baea90e9e5
6 changed files with 763 additions and 811 deletions
+6 -2
View File
@@ -129,7 +129,9 @@ class MongoDB
throw new \BadMethodCallException("Method {$name} does not exist on MongoDB Client or Database.");
} catch (\Throwable $throwable) {
return trigger_print_error(throwable($throwable));
\Kiri::getLogger()->json_log($throwable);
return false;
} finally {
// MongoDB 连接是持久的,不需要释放
$this->pool()->push($this->getName(), $client);
@@ -324,7 +326,9 @@ class MongoDB
return $client;
} catch (\Throwable $e) {
throw new RedisConnectException(sprintf('MongoDB Connect %s Fail: %s', $uri, $e->getMessage()));
\Kiri::getLogger()->json_log($e);
throw new RedisConnectException(sprintf('MongoDB Connect %s Fail: %s', $uri, $e->getMessage()));
}
}