INNER CODE UNIT · Python
readyz
yezz123/ai-template · backend/src/dogeapi/main.py:95
async def readyz() -> dict[str, str | bool]:
db_ok = False
redis_ok = False
engine = create_ready_engine(settings.DATABASE_URL, pool_pre_ping=True)
try:
async with engine.connect() as conn:
await conn.execute(text("select 1"))
db_ok = True
except Exception:
db_ok = False
finally:
await engine.dispose()
redis = Redis.from_url(settings.REDIS_URL, decode_responses=True)
try:
redis_ok = bool(await redis.ping())
except Exception: