fix: SQLite 멀티스레드 I/O 에러 해결
- 요청마다 새 SQLite 연결 생성 (new_connection=True) - 사용 후 명시적 close - 간헐적 'I/O operation on closed file' 에러 방지
This commit is contained in:
@@ -3029,9 +3029,10 @@ def api_member_history(phone):
|
||||
|
||||
transaction_ids = [] # 적립된 거래번호 수집
|
||||
|
||||
# 1. 마일리지 내역 조회 (SQLite)
|
||||
# 1. 마일리지 내역 조회 (SQLite) - 새 연결 사용 (멀티스레드 안전)
|
||||
sqlite_conn = None
|
||||
try:
|
||||
sqlite_conn = db_manager.get_sqlite_connection()
|
||||
sqlite_conn = db_manager.get_sqlite_connection(new_connection=True)
|
||||
cursor = sqlite_conn.cursor()
|
||||
|
||||
# 사용자 정보 조회
|
||||
@@ -3108,6 +3109,13 @@ def api_member_history(phone):
|
||||
|
||||
except Exception as e:
|
||||
logging.warning(f"마일리지 조회 실패: {e}")
|
||||
finally:
|
||||
# SQLite 연결 닫기
|
||||
if sqlite_conn:
|
||||
try:
|
||||
sqlite_conn.close()
|
||||
except:
|
||||
pass
|
||||
|
||||
# 2. 전화번호로 POS 고객코드 조회 (MSSQL)
|
||||
cuscode = None
|
||||
|
||||
Reference in New Issue
Block a user