Spaces:
Running
Running
Update main.py
Browse files
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 |
-
|
|
|
|
| 644 |
produce_progress(analysis_id, user_id, percent, stage, message),
|
| 645 |
loop
|
| 646 |
-
|
| 647 |
-
|
| 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 |
|