π Deployment: Add dnspython and skip blocking ping to fix Vercel startup
Browse files- backend/app.py +3 -3
- backend/requirements.txt +1 -0
backend/app.py
CHANGED
|
@@ -43,12 +43,12 @@ async def _init_db():
|
|
| 43 |
serverSelectionTimeoutMS=5000,
|
| 44 |
tlsCAFile=certifi.where()
|
| 45 |
)
|
| 46 |
-
# Verify connection
|
| 47 |
-
await client.admin.command("ping")
|
| 48 |
_db = client["forgesight"]
|
| 49 |
_inspections_col = _db["inspections"]
|
| 50 |
_journal_col = _db["journal"]
|
| 51 |
-
print("β
MongoDB
|
| 52 |
except Exception as e:
|
| 53 |
print(f"β οΈ MongoDB unavailable ({e}) β using in-memory storage")
|
| 54 |
|
|
|
|
| 43 |
serverSelectionTimeoutMS=5000,
|
| 44 |
tlsCAFile=certifi.where()
|
| 45 |
)
|
| 46 |
+
# Verify connection - Skip ping during startup to avoid Vercel timeouts
|
| 47 |
+
# await client.admin.command("ping")
|
| 48 |
_db = client["forgesight"]
|
| 49 |
_inspections_col = _db["inspections"]
|
| 50 |
_journal_col = _db["journal"]
|
| 51 |
+
print("β
MongoDB client initialized")
|
| 52 |
except Exception as e:
|
| 53 |
print(f"β οΈ MongoDB unavailable ({e}) β using in-memory storage")
|
| 54 |
|
backend/requirements.txt
CHANGED
|
@@ -7,3 +7,4 @@ fpdf==1.7.2
|
|
| 7 |
pydantic>=2.6.4
|
| 8 |
python-dotenv>=1.0.1
|
| 9 |
python-multipart>=0.0.9
|
|
|
|
|
|
| 7 |
pydantic>=2.6.4
|
| 8 |
python-dotenv>=1.0.1
|
| 9 |
python-multipart>=0.0.9
|
| 10 |
+
dnspython==2.6.1
|