feat: 修改默认任务数

This commit is contained in:
caoqianming 2026-01-29 14:33:22 +08:00
parent 13c231637f
commit 50277171d7
1 changed files with 3 additions and 3 deletions

View File

@ -117,7 +117,7 @@ def show_task_run(def_name: str):
return cache.get(def_name, True)
@shared_task(base=CustomTask)
def get_abstract_from_elsevier(publication_year: int = None, number_of_task:int = 100):
def get_abstract_from_elsevier(publication_year: int = None, number_of_task:int = 20):
def_name = get_abstract_from_elsevier.name
if not show_task_run(def_name):
return "stoped"
@ -263,7 +263,7 @@ def can_send_more():
return cache.get(RUNNING_KEY, 0) < MAX_RUNNING
@shared_task(base=CustomTask)
def send_download_fulltext_task(number_of_task=100):
def send_download_fulltext_task(number_of_task=MAX_RUNNING):
qs = Paper.objects.filter(is_oa=True, has_fulltext=False, fail_reason=None)
if not qs.exists():
return "done"
@ -369,7 +369,7 @@ def save_pdf_from_oa_url(paper:Paper):
def save_pdf_from_openalex(paper:Paper):
if cache.get("openalex_api_exceed"):
return "Insufficient credits"
return "find cache Insufficient credits"
# 尝试openalex下载
try:
res = requests.get(url=f"https://content.openalex.org/works/{paper.openalex_id}.pdf",