fix(proxy_server.py): fix prisma client connection error

This commit is contained in:
Krrish Dholakia 2024-01-04 18:28:18 +05:30
parent 6b708347f3
commit 74f6f6489a
8 changed files with 29 additions and 46 deletions

View file

@ -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)