diff --git a/backend/app/models/focus_group.py b/backend/app/models/focus_group.py index 4ffecdbc..78c27275 100644 --- a/backend/app/models/focus_group.py +++ b/backend/app/models/focus_group.py @@ -5,7 +5,6 @@ import traceback import uuid import os import threading -import eventlet import logging # Set up logger for this module @@ -51,22 +50,6 @@ async def emit_websocket_event(event_name: str, focus_group_id: str, data: dict) import traceback print(f"🔔 Full traceback: {traceback.format_exc()}") -def emit_with_ack(event_name: str, focus_group_id: str, payload: dict): - """GPT-5 Optional: Emit with client ACK to prove end-to-end delivery.""" - from app.extensions import socketio - - def _ack_callback(): - print(f"🔧 GPT-5 ACK: Client confirmed receipt of {event_name} for room {focus_group_id}") - - try: - socketio.emit(event_name, payload, room=focus_group_id, callback=_ack_callback, namespace='/') - eventlet.sleep(0) # GPT-5: Yield to eventlet for proper async handling - print(f"🔧 GPT-5: Emitted {event_name} with ACK callback for room {focus_group_id}") - except Exception as e: - print(f"WebSocket emit with ACK error for {event_name}: {e}") - import traceback - traceback.print_exc() - class FocusGroup: @staticmethod async def create(focus_group_data, user_id):