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:
dekun
2026-07-02 15:22:52 +08:00
parent 972ab5d08b
commit 5328673ce8
11 changed files with 215 additions and 33 deletions
+3 -2
View File
@@ -35,6 +35,7 @@ def register(deps) -> None:
expire_old_plans = deps.expire_old_plans
TZ = deps.tz
DB_PATH = deps.db_path
KLINE_DB_PATH = deps.kline_db_path
UPLOAD_DIR = deps.upload_dir
OPEN_TYPES = deps.open_types
EXIT_TRIGGERS = deps.exit_triggers
@@ -147,7 +148,7 @@ def register(deps) -> None:
from modules.core.trading_context import get_trading_mode
data = fetch_market_klines(
symbol, period, DB_PATH, prefer_ctp=False,
symbol, period, KLINE_DB_PATH, prefer_ctp=False,
)
except Exception as exc:
app.logger.warning("kline api failed: %s", exc)
@@ -175,7 +176,7 @@ def register(deps) -> None:
sub = kline_hub.subscribe(symbol, period, market_code, sina_code)
try:
kline_data = fetch_market_klines(
symbol, period, DB_PATH, prefer_ctp=False,
symbol, period, KLINE_DB_PATH, prefer_ctp=False,
)
if kline_data.get("bars"):
yield sse_format("kline", kline_data)