Compare commits
No commits in common. "6d2f2a452c5a39dcf9e5c0f06549bef49cb45411" and "61d933b36c23978b74c25467de1278f167a7ba20" have entirely different histories.
6d2f2a452c
...
61d933b36c
|
|
@ -112,20 +112,19 @@ def get_paper_meta_from_openalex(publication_year:int, keywords:str="", search:s
|
||||||
papers.append(paper)
|
papers.append(paper)
|
||||||
Paper.objects.bulk_create(papers, ignore_conflicts=True)
|
Paper.objects.bulk_create(papers, ignore_conflicts=True)
|
||||||
cache.set(cache_key, next_cursor, timeout=None)
|
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:
|
||||||
if end_year is None:
|
end_year = datetime.now().year
|
||||||
end_year = datetime.now().year
|
if publication_year + 1 <= end_year:
|
||||||
if publication_year + 1 <= end_year:
|
current_app.send_task(
|
||||||
current_app.send_task(
|
"apps.resm.tasks.get_paper_meta_from_openalex",
|
||||||
"apps.resm.tasks.get_paper_meta_from_openalex",
|
kwargs={
|
||||||
kwargs={
|
"publication_year": publication_year + 1,
|
||||||
"publication_year": publication_year + 1,
|
"keywords": keywords,
|
||||||
"keywords": keywords,
|
"search": search,
|
||||||
"search": search,
|
"end_year": end_year
|
||||||
"end_year": end_year
|
},
|
||||||
},
|
countdown=5
|
||||||
countdown=5
|
)
|
||||||
)
|
|
||||||
|
|
||||||
# 常用的 User-Agent 列表
|
# 常用的 User-Agent 列表
|
||||||
USER_AGENTS = [
|
USER_AGENTS = [
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue