feat: get_paper_meta_from_openalex 超过100就存储一下
This commit is contained in:
parent
9af30eccaf
commit
ed213260ca
|
|
@ -43,4 +43,7 @@ def get_paper_meta_from_openalex(publication_year:int, search_key:str):
|
|||
if record["primary_location"] and record["primary_location"]["source"]:
|
||||
paper.publication_name = record["primary_location"]["source"]["display_name"]
|
||||
papers.append(paper)
|
||||
if len(papers) >= 100:
|
||||
Paper.objects.bulk_create(papers, ignore_conflicts=True)
|
||||
papers = []
|
||||
Paper.objects.bulk_create(papers, ignore_conflicts=True)
|
||||
|
|
|
|||
Loading…
Reference in New Issue