#!/usr/bin/env python3 """Test RedisPublisher connection.""" import sys import os import time sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) print("Testing RedisPublisher...") start = time.time() try: sys.path.insert( 0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "scripts") ) from redis_publisher import RedisPublisher print(f"Import successful: {time.time() - start:.1f}s") start = time.time() pub = RedisPublisher("test_uuid") elapsed = time.time() - start print(f"RedisPublisher created: {elapsed:.1f}s") print(f"Enabled: {pub.enabled}") # Try to publish start = time.time() success = pub.info("test", "Test message") elapsed = time.time() - start print(f"Publish attempt: {success}, took {elapsed:.1f}s") except Exception as e: print(f"Error: {e}") import traceback traceback.print_exc()