feat: Enhance review process with streaming events and detailed logging
This commit is contained in:
+15
-3
@@ -29,11 +29,23 @@ class ConnectionManager:
|
||||
|
||||
async def broadcast(self, message: dict):
|
||||
"""Broadcast message to all connected clients"""
|
||||
for connection in self.active_connections:
|
||||
print(f"\n[BROADCAST] Sending to {len(self.active_connections)} clients")
|
||||
print(f"[BROADCAST] Message type: {message.get('type')}")
|
||||
print(f"[BROADCAST] Message: {str(message)[:200]}...")
|
||||
|
||||
sent_count = 0
|
||||
error_count = 0
|
||||
|
||||
for i, connection in enumerate(self.active_connections):
|
||||
try:
|
||||
await connection.send_json(message)
|
||||
except Exception:
|
||||
pass
|
||||
sent_count += 1
|
||||
print(f"[BROADCAST] ✓ Sent to client #{i+1}")
|
||||
except Exception as e:
|
||||
error_count += 1
|
||||
print(f"[BROADCAST] ✗ Failed to send to client #{i+1}: {e}")
|
||||
|
||||
print(f"[BROADCAST] Result: {sent_count} sent, {error_count} failed")
|
||||
|
||||
|
||||
# Create connection manager
|
||||
|
||||
Reference in New Issue
Block a user