AssetManager.API/AssetManager.Infrastructure
OpenClaw Agent ad7761810d fix: 缓存改为 static 解决跨请求并发问题
根因:
- MarketDataService 是 Scoped,每个 HTTP 请求有独立实例
- 两个请求同时查询同一股票,各自有自己的 _memoryCache 和 _pendingPriceRequests
- 导致重复查询数据库,连接冲突

修复:
1. _memoryCache 改为 static,跨请求共享
2. _pendingPriceRequests 改为 static,跨请求共享
3. GetOrAdd 正确模式:先创建 Lazy,再 GetOrAdd

流程:
请求1 → static _memoryCache 未命中 → static _pendingPriceRequests.GetOrAdd
请求2 → static _memoryCache 未命中 → static _pendingPriceRequests.GetOrAdd(复用请求1的 Lazy)
                                              ↓
                                     只查一次数据库
2026-03-24 10:30:55 +00:00
..
Services fix: 缓存改为 static 解决跨请求并发问题 2026-03-24 10:30:55 +00:00
StrategyEngine fix: 请求收益曲线时自动回填历史数据 2026-03-13 16:21:31 +00:00
AssetManager.Infrastructure.csproj feat(市场数据): 添加Yahoo财经服务并设为优先数据源 2026-03-17 12:06:47 +08:00