mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-03 02:22:24 +00:00
refactor(proxy): convert instance methods to static methods in PrismaClient
- Changed `_format_prisma_engine_exit_reason` and `_log_prisma_engine_exit_reason` methods to static methods to improve class design and usability. - Updated method calls to reflect the new static context, ensuring consistent logging of Prisma engine exit reasons and statuses. - Removed unnecessary instance references to streamline the codebase.
This commit is contained in:
parent
6aa84272ec
commit
72d7814695
1 changed files with 4 additions and 8 deletions
|
|
@ -4233,8 +4233,8 @@ class PrismaClient:
|
|||
else:
|
||||
return f"raw_wait_status={wait_status}"
|
||||
|
||||
@staticmethod
|
||||
def _format_prisma_engine_exit_reason(
|
||||
self,
|
||||
*,
|
||||
detection_method: str,
|
||||
wait_status: Optional[int],
|
||||
|
|
@ -4243,11 +4243,11 @@ class PrismaClient:
|
|||
return f"detection_method={detection_method} exit_status=unavailable"
|
||||
return (
|
||||
f"detection_method={detection_method} "
|
||||
f"{self._format_engine_wait_status(wait_status)}"
|
||||
f"{PrismaClient._format_engine_wait_status(wait_status)}"
|
||||
)
|
||||
|
||||
@staticmethod
|
||||
def _log_prisma_engine_exit_reason(
|
||||
self,
|
||||
*,
|
||||
pid: int,
|
||||
detection_method: str,
|
||||
|
|
@ -4256,7 +4256,7 @@ class PrismaClient:
|
|||
verbose_proxy_logger.error(
|
||||
"prisma-query-engine PID %s exited; %s; triggering reconnect.",
|
||||
pid,
|
||||
self._format_prisma_engine_exit_reason(
|
||||
PrismaClient._format_prisma_engine_exit_reason(
|
||||
detection_method=detection_method,
|
||||
wait_status=wait_status,
|
||||
),
|
||||
|
|
@ -4314,10 +4314,6 @@ class PrismaClient:
|
|||
detection_method="waitpid watch start",
|
||||
wait_status=wait_status,
|
||||
)
|
||||
verbose_proxy_logger.warning(
|
||||
"prisma-query-engine PID %s already dead at watch start; triggering reconnect.",
|
||||
pid,
|
||||
)
|
||||
self._engine_confirmed_dead = True
|
||||
self._reap_all_zombies()
|
||||
self._cleanup_engine_watcher()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue