Files
momentry_core/test_redis_publisher.py
Warren b54c2def30 feat: add migrations, test scripts, and utility tools
- Add database migrations (006-028) for face recognition, identity, file_uuid
- Add test scripts for ASR, face, search, processing
- Add portal frontend (Tauri)
- Add config, benchmark, and monitoring utilities
- Add model checkpoints and pretrained model references
2026-04-30 15:11:53 +08:00

40 lines
910 B
Python

#!/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()