fix: use aware UTC in health timestamp (#4503)
This commit is contained in:
parent
804691501f
commit
790ef81b06
1 changed files with 2 additions and 2 deletions
4
app.py
4
app.py
|
|
@ -39,7 +39,7 @@ load_dotenv(encoding="utf-8-sig")
|
||||||
import asyncio
|
import asyncio
|
||||||
import logging
|
import logging
|
||||||
import secrets
|
import secrets
|
||||||
from datetime import datetime
|
from datetime import datetime, timezone
|
||||||
from typing import Dict
|
from typing import Dict
|
||||||
|
|
||||||
from contextlib import asynccontextmanager
|
from contextlib import asynccontextmanager
|
||||||
|
|
@ -863,7 +863,7 @@ async def get_version():
|
||||||
|
|
||||||
@app.get("/api/health")
|
@app.get("/api/health")
|
||||||
async def health_check() -> Dict[str, str]:
|
async def health_check() -> Dict[str, str]:
|
||||||
return {"status": "healthy", "timestamp": datetime.utcnow().isoformat()}
|
return {"status": "healthy", "timestamp": datetime.now(timezone.utc).isoformat()}
|
||||||
|
|
||||||
@app.get("/api/ready")
|
@app.get("/api/ready")
|
||||||
async def readiness_check() -> JSONResponse:
|
async def readiness_check() -> JSONResponse:
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue