|
@@ -82,7 +82,7 @@ def _build_task_dict(api_task, device_id, account_password, account_name, schedu
|
|
|
"_device_id": device_id,
|
|
"_device_id": device_id,
|
|
|
"_platform": str(PLATFORM_ID),
|
|
"_platform": str(PLATFORM_ID),
|
|
|
"collect_task_id": str(api_task.get("id", "")),
|
|
"collect_task_id": str(api_task.get("id", "")),
|
|
|
- "snapshot_collect_status": api_task.get("snapshot_collect_status"),
|
|
|
|
|
|
|
+ "snapshot_collect_status": api_task.get("snapshot_collect_status",1),
|
|
|
"sampling_cycle": "",
|
|
"sampling_cycle": "",
|
|
|
"sampling_start_time": "",
|
|
"sampling_start_time": "",
|
|
|
"sampling_end_time": "",
|
|
"sampling_end_time": "",
|
|
@@ -174,7 +174,7 @@ if __name__ == "__main__":
|
|
|
logger.info("拉取到任务: %s", json.dumps(log_dict, ensure_ascii=False))
|
|
logger.info("拉取到任务: %s", json.dumps(log_dict, ensure_ascii=False))
|
|
|
|
|
|
|
|
# 根据 snapshot_collect_status 选爬虫
|
|
# 根据 snapshot_collect_status 选爬虫
|
|
|
- snapshot_status = task_dict.get("snapshot_collect_status", 0)
|
|
|
|
|
|
|
+ snapshot_status = task_dict.get("snapshot_collect_status")
|
|
|
if not snapshot_status:
|
|
if not snapshot_status:
|
|
|
spider_cls = YaoShiBangSnapshot
|
|
spider_cls = YaoShiBangSnapshot
|
|
|
logger.info("任务 %s 启用快照模式", task_id)
|
|
logger.info("任务 %s 启用快照模式", task_id)
|