Leesn465 commited on
Commit
8c26bc9
·
verified ·
1 Parent(s): 50fc952

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +4 -5
main.py CHANGED
@@ -640,13 +640,12 @@ async def consume_loop():
640
  # ✅ threadpool에서 호출될 progress 콜백
641
  def progress_cb(percent: int, stage: str, message: str):
642
  # threadpool(다른 스레드) -> 현재 이벤트루프에서 코루틴 실행
643
- fut = asyncio.run_coroutine_threadsafe(
 
644
  produce_progress(analysis_id, user_id, percent, stage, message),
645
  loop
646
- )
647
- # (선택) progress 전송 실패 로그 보고 싶으면:
648
- try:
649
- fut.result(timeout=2)
650
  except Exception as e:
651
  logger.warning(f"[KAFKA] progress send failed: {e}")
652
 
 
640
  # ✅ threadpool에서 호출될 progress 콜백
641
  def progress_cb(percent: int, stage: str, message: str):
642
  # threadpool(다른 스레드) -> 현재 이벤트루프에서 코루틴 실행
643
+ try:
644
+ asyncio.run_coroutine_threadsafe(
645
  produce_progress(analysis_id, user_id, percent, stage, message),
646
  loop
647
+ )
648
+
 
 
649
  except Exception as e:
650
  logger.warning(f"[KAFKA] progress send failed: {e}")
651