add exp backoff on connection issues

This commit is contained in:
SwiftyOS
2024-09-12 10:59:40 +02:00
parent 70c7a3b1f3
commit 7326ee1221

View File

@@ -31,7 +31,7 @@ async def connect(call_count=0):
except Exception as e:
if call_count <= 5:
logger.info(f"[Prisma-{conn_id}] Connection failed: {e}. Retrying now..")
await asyncio.sleep(call_count)
await asyncio.sleep(2**call_count)
await connect(call_count + 1)
else:
raise e