fix(HEL-494): 盘中双免费源故障切换并禁止问天假0覆盖

主源东财失败后自动改走腾讯行情,成功结果写入缓存;两源都失败时返回最近真实快照并标明延迟,不再显示假0。

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: multica-agent <github@multica.ai>
This commit is contained in:
总工
2026-09-08 17:38:38 +08:00
co-authored by Cursor multica-agent
parent b5d65ecb41
commit ef13d6feb5
13 changed files with 588 additions and 92 deletions
+10
View File
@@ -133,6 +133,13 @@ class FakeFreeAggregator:
def tencent_market_quotes(self, codes, expected_date=""):
return self.eastmoney_market_quotes(expected_date)
def tencent_stock_quotes(self, codes, expected_date="", minimum=None):
wanted = {str(code).strip() for code in (codes or []) if str(code).strip()}
rows = self.tencent_market_quotes(codes, expected_date)
if not wanted:
return rows
return [row for row in rows if str(row.get("ts_code") or "") in wanted]
def eastmoney_indices(self):
return [
{
@@ -318,6 +325,9 @@ class RealtimeDashboardTests(unittest.TestCase):
def tencent_market_quotes(self, codes, expected_date=""):
return list(FREE_QUOTES)
def tencent_stock_quotes(self, codes, expected_date="", minimum=None):
return list(FREE_QUOTES)
self.client.query = query
self.client.realtime_aggregator = TencentOnlyAggregator()
TushareClient._realtime_reference_cache.clear()