From 4691d65c14958803b910c89ca5e6132c61a5dc5c Mon Sep 17 00:00:00 2001 From: thug0bin Date: Fri, 27 Feb 2026 16:11:44 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20/admin/user/=20SQLite=20=EC=97=B0?= =?UTF-8?q?=EA=B2=B0=20=EC=97=90=EB=9F=AC=20=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - new_connection=True + finally close 적용 --- backend/app.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/backend/app.py b/backend/app.py index 0a2e837..09386e3 100644 --- a/backend/app.py +++ b/backend/app.py @@ -1233,9 +1233,10 @@ def admin_transaction_detail(transaction_id): @app.route('/admin/user/') def admin_user_detail(user_id): """사용자 상세 이력 조회 - 구매 이력, 적립 이력, 구매 품목""" + conn = None try: - # 1. SQLite 연결 - conn = db_manager.get_sqlite_connection() + # 1. SQLite 연결 (새 연결 사용) + conn = db_manager.get_sqlite_connection(new_connection=True) cursor = conn.cursor() # 2. 사용자 기본 정보 조회 @@ -1401,10 +1402,18 @@ def admin_user_detail(user_id): }) except Exception as e: + import traceback + logging.error(f"사용자 상세 조회 실패: {e}\n{traceback.format_exc()}") return jsonify({ 'success': False, 'message': f'조회 실패: {str(e)}' }), 500 + finally: + if conn: + try: + conn.close() + except: + pass @app.route('/admin/search/user')