fix ProxyStartupEvent._setup_prisma_client

This commit is contained in:
Ishaan Jaff 2024-11-05 19:46:05 -08:00
parent 7ff3f382b1
commit 4d411fc9b4
2 changed files with 4 additions and 3 deletions

View file

@ -3022,6 +3022,7 @@ class ProxyStartupEvent:
- Sets up prisma client
- Adds necessary views to proxy
"""
verbose_proxy_logger.debug("Setting up Prisma Client...")
prisma_client: Optional[PrismaClient] = None
if database_url is not None:
try:
@ -3033,6 +3034,8 @@ class ProxyStartupEvent:
await prisma_client.connect()
verbose_proxy_logger.debug("Success - Connected Prisma Client to DB")
## Add necessary views to proxy ##
asyncio.create_task(
prisma_client.check_view_exists()
@ -3047,6 +3050,7 @@ async def startup_event():
import json
init_verbose_loggers()
verbose_proxy_logger.debug("Starting up LiteLLM Proxy...")
### LOAD MASTER KEY ###
# check if master key set in environment - load from there

View file

@ -2289,9 +2289,6 @@ class PrismaClient:
verbose_proxy_logger.debug(
"PrismaClient: connect() called Attempting to Connect to DB"
)
verbose_proxy_logger.debug(
"PrismaClient: DB not connected, Attempting to Connect to DB"
)
await self.db.connect()
except Exception as e:
import traceback