feat(Core/UI): 백테스트 전역 엔진 선택 버튼 추가 및 스캘핑 Rust 방어로직 포팅 1차 완료
This commit is contained in:
40
scratch/check_auth_empty_rows.py
Normal file
40
scratch/check_auth_empty_rows.py
Normal file
@@ -0,0 +1,40 @@
|
||||
import sys, os
|
||||
sys.path.append(os.path.dirname(os.path.abspath(__file__)) + '/..')
|
||||
from database import TradeDB
|
||||
|
||||
db = TradeDB()
|
||||
try:
|
||||
# id=110, 111 전후 env_config 행 확인 (같은 시각에 뭘 저장했는지)
|
||||
print("[env_config: 2026-08-28 15:25~15:45 범위]")
|
||||
rows = db.conn.execute("""
|
||||
SELECT id, created_at FROM env_config
|
||||
WHERE created_at BETWEEN '2026-08-28 15:25:00' AND '2026-08-28 15:45:00'
|
||||
ORDER BY id
|
||||
""").fetchall()
|
||||
for r in rows:
|
||||
print(f" env_config: {dict(r)}")
|
||||
|
||||
# env_auth_config 빈 행 전체 개수
|
||||
print("\n[env_auth_config 빈 행 현황]")
|
||||
empty = db.conn.execute("""
|
||||
SELECT id, created_at FROM env_auth_config
|
||||
WHERE KIS_APP_KEY_REAL IS NULL AND KIS_APP_KEY IS NULL
|
||||
ORDER BY id DESC LIMIT 20
|
||||
""").fetchall()
|
||||
print(f" 총 빈 행: {len(empty)}개")
|
||||
for r in empty:
|
||||
print(f" {dict(r)}")
|
||||
|
||||
# _read_latest_env_auth 실제 동작 확인 - 최신 비어있지 않은 행
|
||||
print("\n[_read_latest_env_auth가 읽는 행 (DESC LIMIT 1)]")
|
||||
latest = db.conn.execute("""
|
||||
SELECT id, created_at, KIS_APP_KEY_REAL, KIS_APP_KEY_OB_REAL
|
||||
FROM env_auth_config ORDER BY id DESC LIMIT 1
|
||||
""").fetchone()
|
||||
d = dict(latest) if latest else {}
|
||||
for k in ['KIS_APP_KEY_REAL', 'KIS_APP_KEY_OB_REAL']:
|
||||
if d.get(k):
|
||||
d[k] = d[k][:6] + '...'
|
||||
print(f" {d}")
|
||||
finally:
|
||||
db.close()
|
||||
Reference in New Issue
Block a user