"""Simple Redis connection test."""
import asyncio
import redis.asyncio as aioredis

async def test_redis():
    try:
        client = aioredis.Redis(
            host='redis-14473.c93.us-east-1-3.ec2.cloud.redislabs.com',
            port=14473,
            password='4kCCXXaJXXv7k358eG69p1lDBQtHTbQ1',
            username='default',
            decode_responses=True,
            socket_connect_timeout=10,
        )
        result = await client.ping()
        print(f"✅ Redis PING: {result}")
        
        # Test set/get
        await client.set("test_key", "hello_opennotion")
        value = await client.get("test_key")
        print(f"✅ Redis SET/GET: {value}")
        
        await client.close()
        print("✅ Redis connection successful!")
    except Exception as e:
        print(f"❌ Redis error: {e}")

if __name__ == "__main__":
    asyncio.run(test_redis())
