|
|
|
@ -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() |
|
|
|
|