feat: get_paper_meta_from_openalex 添加软停止
Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
parent
4090ce457d
commit
1d8d829797
|
|
@ -112,6 +112,7 @@ 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:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue