From b05b88937d3f3617a075a954038a81d61c31b5e7 Mon Sep 17 00:00:00 2001 From: zzx Date: Sat, 20 Sep 2025 11:56:16 +0800 Subject: [PATCH] =?UTF-8?q?feat(run):=20=E6=81=A2=E5=A4=8D=E7=B4=A7?= =?UTF-8?q?=E6=80=A5=E4=BB=BB=E5=8A=A1=E5=88=A4=E6=96=AD=E9=80=BB=E8=BE=91?= =?UTF-8?q?=E5=B9=B6=E7=A7=BB=E9=99=A4=E8=B0=83=E8=AF=95=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 恢复了对紧急任务数量的判断逻辑,当任务状态无效时会检查是否存在紧急任务, 若无紧急任务则直接返回。同时移除了多余的调试注释代码,保持逻辑清晰。 --- run.py | 35 +++++------------------------------ 1 file changed, 5 insertions(+), 30 deletions(-) diff --git a/run.py b/run.py index 06e98e2..2ef21f5 100644 --- a/run.py +++ b/run.py @@ -71,41 +71,16 @@ def get_spider(platform_id, prompt, brand, browser) -> None | DeepseekSpider | T async def ai_seo_job(browser, platform_ids, time_range, job_id, type_name, run_id): status, date = calc_task_date(time_range) - # if not status: - # # 是否有紧急任务 - # task_result = await AiSeoApis.get_urgent_task_count() - # if task_result['count'] <= 0: - # return + if not status: + # 是否有紧急任务 + task_result = await AiSeoApis.get_urgent_task_count() + if task_result['count'] <= 0: + return current_job = scheduler.get_job(job_id) # current_job.pause() platform_str = ','.join(platform_ids) # 获取任务信息 task_data = await AiSeoApis.get_one_task(date=date, platform_ids=platform_str) - # task_data = { - # "id": "778877538494716115", - # "project_id": "778865951931242406", - # "keyword_id": "778865954200359933", - # "keyword": "考研班哪个机构好", - # "brand": "高顿教育", - # "platform_id": "13", - # "gather_date": "2025-06-26", - # "gather_time": "00:00", - # "gather_filter": "2025-06-26 00:00:00", - # "status": 2, - # "retry_count": 0, - # "screen_flag": 2, - # "thinking": 1, - # "is_deal": 1, - # "screen_url": "", - # "priority": 999, - # "start_time": "null", - # "end_time": "null", - # "create_time": "2025-06-26 15:09:24", - # "update_time": "2025-06-26 18:19:55", - # "delete_time": 0, - # "create_by": "777786292267261539", - # "update_by": "777786292267261539" - # } if not task_data: logger.info(f'[{type_name}]未获取到任务信息') # current_job.resume()