Add separate kline.db and pre-seed small-account four-product K-lines on startup.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -17,7 +17,7 @@ from typing import Callable, Optional
|
||||
from zoneinfo import ZoneInfo
|
||||
|
||||
from modules.market.kline_chart import fetch_market_klines, ths_to_sina_chart_symbol
|
||||
from modules.market.kline_store import is_cache_fresh, load_meta, ensure_kline_tables
|
||||
from modules.market.kline_store import connect_kline_db, is_cache_fresh, load_meta, ensure_kline_tables
|
||||
from modules.market.market_sessions import is_trading_session
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
@@ -87,8 +87,10 @@ class KlineStreamHub:
|
||||
if is_trading_session() and sub.period in FAST_PERIODS:
|
||||
return True
|
||||
try:
|
||||
from modules.core.db_conn import connect_db
|
||||
conn = connect_db(db_path)
|
||||
from modules.core.paths import KLINE_DB_PATH
|
||||
|
||||
db_path = db_path or KLINE_DB_PATH
|
||||
conn = connect_kline_db(db_path)
|
||||
ensure_kline_tables(conn)
|
||||
meta = load_meta(conn, chart_sym, sub.period)
|
||||
conn.close()
|
||||
|
||||
Reference in New Issue
Block a user