mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 10:44:24 +00:00
fix(proxy_server.py): fix prisma client connection error
This commit is contained in:
parent
6b708347f3
commit
74f6f6489a
8 changed files with 29 additions and 46 deletions
|
@ -255,7 +255,6 @@ class PrismaClient:
|
|||
)
|
||||
## init logging object
|
||||
self.proxy_logging_obj = proxy_logging_obj
|
||||
self.connected = False
|
||||
os.environ["DATABASE_URL"] = database_url
|
||||
# Save the current working directory
|
||||
original_dir = os.getcwd()
|
||||
|
@ -536,11 +535,7 @@ class PrismaClient:
|
|||
)
|
||||
async def connect(self):
|
||||
try:
|
||||
if self.connected == False:
|
||||
await self.db.connect()
|
||||
self.connected = True
|
||||
else:
|
||||
return
|
||||
await self.db.connect()
|
||||
except Exception as e:
|
||||
asyncio.create_task(
|
||||
self.proxy_logging_obj.failure_handler(original_exception=e)
|
||||
|
@ -558,7 +553,6 @@ class PrismaClient:
|
|||
async def disconnect(self):
|
||||
try:
|
||||
await self.db.disconnect()
|
||||
self.connected = False
|
||||
except Exception as e:
|
||||
asyncio.create_task(
|
||||
self.proxy_logging_obj.failure_handler(original_exception=e)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue