I'm using Python FastAPI on Vercel, and I'm encountering a 500 timeout error on the first request. Has anyone experienced a similar issue? If you know how to resolve it, I would appreciate your help.
ERROR:uvicorn.error:Unhandled error: 127.0.0.1 - - [10/Jan/2025 01:15:48] "GET /health/db HTTP/1.1" 500 -
This is test code for checking a health state of Database
@router.get("/health/db")def check_db_connection(session: SessionDep): try: session.execute(text("SELECT 1")) return {"status": "Database connection is healthy"} except SQLAlchemyError as e: raise HTTPException( status_code=500, detail=f"Database connection error: {str(e)}" )
