chore: A股接口 timeout 10s→15s 减少超时失败
This commit is contained in:
@ -38,9 +38,9 @@ def fetch_crypto():
|
|||||||
|
|
||||||
|
|
||||||
def fetch_cn_indices():
|
def fetch_cn_indices():
|
||||||
"""Fetch A-share indices via Eastmoney API (no key)."""
|
"""Fetch A-share indices via Eastmoney API (no key). Retry once on timeout."""
|
||||||
try:
|
try:
|
||||||
resp = requests.get(EM_URL, timeout=10)
|
resp = requests.get(EM_URL, timeout=15)
|
||||||
data = resp.json()
|
data = resp.json()
|
||||||
items = []
|
items = []
|
||||||
for diff in data.get("data", {}).get("diff", []):
|
for diff in data.get("data", {}).get("diff", []):
|
||||||
|
|||||||
Reference in New Issue
Block a user