feat(存储): JSON data store 升级 SQLite(迭代 06,R-008)
- 新增 SqliteStore(node:sqlite 封装):strategy_holdings 持仓生命周期表 + market_quotes_cache 行情缓存表 - DataStore 改造为门面委托 SqliteStore,保留兼容 API,启动检测自动迁移(幂等) - PositionManager 适配单票生命周期(openHolding/addShares/reduceShares/closeHolding),清仓转历史保留 - 新增一次性迁移脚本 scripts/migrate-json-to-sqlite.mjs + pnpm migrate 命令 - 修复 addToStrategy 语义 Bug(新增量 vs 绝对目标量),真实 API CRUD 回归通过 - 移除策略 tab 一键清零按钮及 remove-all-shares 端点(clearStrategyShares 保留供删除策略联动) - 插件 dispose 补充 storage.close() 关闭 SQLite 连接
This commit is contained in:
@@ -86,6 +86,7 @@ async function apply(ctx, config) {
|
||||
return () => {
|
||||
marketFeed.stop();
|
||||
qmtHealthMonitor.stop();
|
||||
storage.close(); // 关闭 SQLite 连接(迭代 06)
|
||||
logger.info('[one-divine-lot] 插件已释放');
|
||||
};
|
||||
}, 'one-divine-lot.dispose');
|
||||
|
||||
Reference in New Issue
Block a user