16 lines
448 B
Python
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())
|