板块缓存
This commit is contained in:
@@ -366,9 +366,7 @@ async def fetch_sector_list(sector_type: str) -> list[dict]:
|
|||||||
data = await _fetch_akshare(sector_type)
|
data = await _fetch_akshare(sector_type)
|
||||||
if data:
|
if data:
|
||||||
_sector_cache[sector_type] = (data, now)
|
_sector_cache[sector_type] = (data, now)
|
||||||
ttl = _sector_ttl_hours()
|
# akshare 数据源更新不确定,不写入磁盘缓存
|
||||||
if ttl > 0:
|
|
||||||
set_cache(cache_key, json.dumps(data, ensure_ascii=False), ttl_hours=ttl)
|
|
||||||
return data
|
return data
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user