'commit'
This commit is contained in:
@@ -232,8 +232,9 @@ async def get_station_list(d, service, uploader, max_stations_count=MAX_STATIONS
|
|||||||
continue
|
continue
|
||||||
|
|
||||||
# 正常处理新场站
|
# 正常处理新场站
|
||||||
logger.info(f">>> 发现新场站 '{station_name}',开始处理...")
|
logger.info(f">>> 发现新场站 '{station_name}',开始处理... ({total_processed_count + 1}/{max_stations_count})")
|
||||||
new_stations_processed += 1
|
new_stations_processed += 1
|
||||||
|
total_processed_count += 1
|
||||||
|
|
||||||
click_x, click_y = card["click_point"]
|
click_x, click_y = card["click_point"]
|
||||||
logger.info(f"准备处理场站: {station_name}, 点击坐标: ({click_x}, {click_y})")
|
logger.info(f"准备处理场站: {station_name}, 点击坐标: ({click_x}, {click_y})")
|
||||||
@@ -391,6 +392,13 @@ async def get_station_list(d, service, uploader, max_stations_count=MAX_STATIONS
|
|||||||
cleaned = Kit.clean_station_name(station_name)
|
cleaned = Kit.clean_station_name(station_name)
|
||||||
await redis_kit.set_data(f"crawled:xdt:{cleaned}", "1", expire=REDIS_STATION_EXPIRE)
|
await redis_kit.set_data(f"crawled:xdt:{cleaned}", "1", expire=REDIS_STATION_EXPIRE)
|
||||||
|
|
||||||
|
# 检查是否已达到最大采集数量
|
||||||
|
if total_processed_count >= max_stations_count:
|
||||||
|
logger.info(f"已达到目标采集数量 {max_stations_count},准备结束采集。")
|
||||||
|
break
|
||||||
|
if total_processed_count >= max_stations_count:
|
||||||
|
break
|
||||||
|
|
||||||
# 清理已完成的后台任务
|
# 清理已完成的后台任务
|
||||||
done_tasks = [t for t in background_tasks if t.done()]
|
done_tasks = [t for t in background_tasks if t.done()]
|
||||||
for t in done_tasks:
|
for t in done_tasks:
|
||||||
@@ -490,7 +498,7 @@ async def main(service=None, do_cleanup=True):
|
|||||||
# await service.cleanup_old_data()
|
# await service.cleanup_old_data()
|
||||||
|
|
||||||
# 获取场站列表
|
# 获取场站列表
|
||||||
stations = await get_station_list(d, service, uploader, max_scrolls=MAX_SCROLLS)
|
stations = await get_station_list(d, service, uploader, max_stations_count=MAX_STATIONS_COUNT)
|
||||||
|
|
||||||
if stations:
|
if stations:
|
||||||
logger.info("场站列表采集完成。")
|
logger.info("场站列表采集完成。")
|
||||||
|
|||||||
Reference in New Issue
Block a user