Neda/Back/tests/test_redis.py
2026-03-28 15:37:02 +03:30

16 lines
448 B
Python

import asyncio
import redis.asyncio as redis
from core.config import settings
async def test_redis():
print(f"Testing connection to: {settings.REDIS_URL}")
try:
client = redis.from_url(settings.REDIS_URL, decode_responses=True)
pong = await client.ping()
print(f"Ping successful: {pong}")
except Exception as e:
print(f"Connection failed: {e}")
if __name__ == "__main__":
asyncio.run(test_redis())