From 3e3934e2e5bf0e73428a17024ea5a8eb6e294016 Mon Sep 17 00:00:00 2001 From: thug0bin Date: Thu, 26 Feb 2026 20:41:40 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20AI=20=EC=97=85=EC=85=80=EB=A7=81=20?= =?UTF-8?q?=EC=83=9D=EC=84=B1=EC=9D=84=20=EB=B3=84=EB=8F=84=20=EC=8A=A4?= =?UTF-8?q?=EB=A0=88=EB=93=9C=EB=A1=9C=20=EB=B6=84=EB=A6=AC=20=E2=80=94=20?= =?UTF-8?q?=ED=82=A4=EC=98=A4=EC=8A=A4=ED=81=AC=20=EC=A0=81=EB=A6=BD=20?= =?UTF-8?q?=EC=9D=91=EB=8B=B5=20=EB=B8=94=EB=A1=9C=ED=82=B9=20=EB=B0=A9?= =?UTF-8?q?=EC=A7=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 4.6 --- backend/app.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/backend/app.py b/backend/app.py index ccabb91..4ba8651 100644 --- a/backend/app.py +++ b/backend/app.py @@ -2384,11 +2384,14 @@ def api_kiosk_claim(): except Exception as alimtalk_err: logging.warning(f"[알림톡] 발송 예외 (적립은 완료): {alimtalk_err}") - # AI 업셀링 추천 생성 (fire-and-forget) - try: - _generate_upsell_recommendation(user_id, transaction_id, sale_items, user_name) - except Exception as rec_err: - logging.warning(f"[AI추천] 생성 예외 (적립은 완료): {rec_err}") + # AI 업셀링 추천 생성 (별도 스레드 — 적립 응답 블로킹 방지) + import threading + def _bg_upsell(): + try: + _generate_upsell_recommendation(user_id, transaction_id, sale_items, user_name) + except Exception as rec_err: + logging.warning(f"[AI추천] 생성 예외 (적립은 완료): {rec_err}") + threading.Thread(target=_bg_upsell, daemon=True).start() return jsonify({ 'success': True,