Compare commits

..

No commits in common. "6d2f2a452c5a39dcf9e5c0f06549bef49cb45411" and "61d933b36c23978b74c25467de1278f167a7ba20" have entirely different histories.

1 changed files with 13 additions and 14 deletions

View File

@ -112,20 +112,19 @@ def get_paper_meta_from_openalex(publication_year:int, keywords:str="", search:s
papers.append(paper)
Paper.objects.bulk_create(papers, ignore_conflicts=True)
cache.set(cache_key, next_cursor, timeout=None)
if cache.get("get_paper_meta_from_openalex_stop") is not None:
if end_year is None:
end_year = datetime.now().year
if publication_year + 1 <= end_year:
current_app.send_task(
"apps.resm.tasks.get_paper_meta_from_openalex",
kwargs={
"publication_year": publication_year + 1,
"keywords": keywords,
"search": search,
"end_year": end_year
},
countdown=5
)
if end_year is None:
end_year = datetime.now().year
if publication_year + 1 <= end_year:
current_app.send_task(
"apps.resm.tasks.get_paper_meta_from_openalex",
kwargs={
"publication_year": publication_year + 1,
"keywords": keywords,
"search": search,
"end_year": end_year
},
countdown=5
)
# 常用的 User-Agent 列表
USER_AGENTS = [