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')