This commit is contained in:
k00kzaAntonovaIra
2026-11-22 19:55:50 +03:00
parent 470d9d6f1e
commit 2d10a9b788
186 changed files with 15732 additions and 425 deletions
+15
View File
@@ -0,0 +1,15 @@
"""Простые проверки соединения с общими хранилищами."""
from redis.asyncio import Redis
from sqlalchemy import text
from sqlalchemy.ext.asyncio import AsyncEngine
async def check_database(engine: AsyncEngine) -> bool:
async with engine.connect() as connection:
await connection.execute(text("SELECT 1"))
return True
async def check_redis(client: Redis) -> bool:
return bool(await client.ping())