feat(Core/UI): 백테스트 전역 엔진 선택 버튼 추가 및 스캘핑 Rust 방어로직 포팅 1차 완료
This commit is contained in:
34
scratch/patch_env_ext.py
Normal file
34
scratch/patch_env_ext.py
Normal file
@@ -0,0 +1,34 @@
|
||||
import sys, os, datetime
|
||||
sys.path.append(os.path.dirname(os.path.abspath(__file__)) + '/..')
|
||||
from database import TradeDB
|
||||
|
||||
db = TradeDB()
|
||||
try:
|
||||
now = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")
|
||||
|
||||
# env_config_ext 컬럼 확인
|
||||
cols = [dict(r)["Field"] for r in db.conn.execute("SHOW COLUMNS FROM env_config_ext").fetchall()]
|
||||
print("[env_config_ext 컬럼]:", cols)
|
||||
|
||||
# 현재 값 확인
|
||||
current = db.conn.execute(
|
||||
"SELECT * FROM env_config_ext WHERE env_key = 'WS_ORDERBOOK_SAVE_KIS'"
|
||||
).fetchone()
|
||||
print("현재 WS_ORDERBOOK_SAVE_KIS:", dict(current) if current else "없음")
|
||||
|
||||
# UPSERT
|
||||
db.conn.execute(
|
||||
"INSERT INTO env_config_ext (env_key, env_value, updated_at) "
|
||||
"VALUES (%s, %s, %s) "
|
||||
"ON DUPLICATE KEY UPDATE env_value=VALUES(env_value), updated_at=VALUES(updated_at)",
|
||||
("WS_ORDERBOOK_SAVE_KIS", "true", now),
|
||||
)
|
||||
db.conn.commit()
|
||||
|
||||
# 재조회 검증
|
||||
after = db.conn.execute(
|
||||
"SELECT * FROM env_config_ext WHERE env_key = 'WS_ORDERBOOK_SAVE_KIS'"
|
||||
).fetchone()
|
||||
print("패치 후 값:", dict(after))
|
||||
finally:
|
||||
db.close()
|
||||
Reference in New Issue
Block a user