feat: all remaining Tencent API price fetchers now DB-first (8 files)
This commit is contained in:
@@ -55,7 +55,14 @@ def _market_prefix(code):
|
||||
|
||||
|
||||
def get_quote(code):
|
||||
"""获取腾讯API行情数据(带60秒缓存)"""
|
||||
"""获取行情数据。DB 优先(price_monitor 维护),腾讯 API fallback"""
|
||||
# DB 优先
|
||||
try:
|
||||
from mofin_db import get_price_from_db
|
||||
p, chg = get_price_from_db(code)
|
||||
if p: return {"code": code, "price": p, "change_pct": chg or 0}
|
||||
except: pass
|
||||
# Fallback: 腾讯 API
|
||||
import time
|
||||
_cache = get_quote.__dict__.get("_cache", {})
|
||||
now = time.time()
|
||||
|
||||
Reference in New Issue
Block a user