fix: AI 업셀링 생성을 별도 스레드로 분리 — 키오스크 적립 응답 블로킹 방지

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
thug0bin 2026-02-26 20:41:40 +09:00
parent 5042cffb9f
commit 3e3934e2e5

View File

@ -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,