mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 10:44:24 +00:00
fix(proxy_server.py): don't reconnect prisma if already connected
This commit is contained in:
parent
e97eff4243
commit
cd350ab8d8
3 changed files with 8 additions and 4 deletions
|
@ -1156,7 +1156,7 @@ async def startup_event():
|
|||
|
||||
### CONNECT TO DB ###
|
||||
# check if DATABASE_URL in environment - load from there
|
||||
if os.getenv("DATABASE_URL", None) is not None and prisma_client is None:
|
||||
if prisma_client is None:
|
||||
prisma_setup(database_url=os.getenv("DATABASE_URL"))
|
||||
|
||||
### LOAD CONFIG ###
|
||||
|
@ -1184,7 +1184,7 @@ async def startup_event():
|
|||
) # start the background health check coroutine.
|
||||
|
||||
verbose_proxy_logger.debug(f"prisma client - {prisma_client}")
|
||||
if prisma_client:
|
||||
if prisma_client is not None:
|
||||
await prisma_client.connect()
|
||||
|
||||
if prisma_client is not None and master_key is not None:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue