fix(resm): openalex PDF 下载请求补 timeout
save_pdf_from_openalex 的 content.openalex.org 请求此前未设超时, 单次请求挂死会拖过 120s alive 心跳, 触发 ensure_fetch_running 重复点火、 叠加并发链狂打 API。补 timeout=(3,15) 与 elsevier 各处一致, 超时由外层 RequestException 捕获并正常收尾。 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
75d02814c6
commit
1e54070d6d
|
|
@ -839,7 +839,8 @@ def save_pdf_from_openalex(paper:Paper):
|
|||
res = requests.get(url=f"https://content.openalex.org/works/{paper.openalex_id}.pdf",
|
||||
params={
|
||||
"api_key": OPENALEX_KEY
|
||||
})
|
||||
},
|
||||
timeout=(3, 15))
|
||||
except requests.RequestException as e:
|
||||
return f"openalex_pdf_error: {str(e)}"
|
||||
if res.status_code == 200:
|
||||
|
|
|
|||
Loading…
Reference in New Issue