From ed213260cafb4e0a05634c151cc2169e854519d1 Mon Sep 17 00:00:00 2001 From: caoqianming Date: Fri, 23 Jan 2026 11:24:08 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20get=5Fpaper=5Fmeta=5Ffrom=5Fopenalex=20?= =?UTF-8?q?=E8=B6=85=E8=BF=87100=E5=B0=B1=E5=AD=98=E5=82=A8=E4=B8=80?= =?UTF-8?q?=E4=B8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/resm/tasks.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apps/resm/tasks.py b/apps/resm/tasks.py index 14c754f..079d9d6 100644 --- a/apps/resm/tasks.py +++ b/apps/resm/tasks.py @@ -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)