fix: 移除 push_to_remote 的 print(data),避免日志撑爆磁盘

每条 job 含 base_data 几十KB,全量 print 到 stdout 导致
Docker json-file 日志无限增长(930GB+)
This commit is contained in:
win 2026-03-23 10:58:41 +08:00
parent f77c010330
commit 20cb35fc6e

View File

@ -59,20 +59,18 @@ async def push_to_remote(data: Dict[str, Any]) -> bool:
source_type = data.get("source_type", "未知平台") source_type = data.get("source_type", "未知平台")
title = data.get("title", "未知职位") title = data.get("title", "未知职位")
company = data.get("company_name", data.get("name", "未知公司")) company = data.get("company_name", data.get("name", "未知公司"))
logger.info(f"上报数据: [{source_type}] {title} - {company}")
print(data)
# try: try:
# url = _build_auth_url() url = _build_auth_url()
# client = get_http_client() client = get_http_client()
# response = await client.post(url, json=data, headers=_PUSH_HEADERS) response = await client.post(url, json=data, headers=_PUSH_HEADERS)
# if response.status_code == 200: if response.status_code == 200:
# return True return True
# logger.error(f"数据发送失败: {response.status_code} - {response.text[:100]}") logger.error(f"数据发送失败: {response.status_code} - {response.text[:100]}")
# return False return False
# except Exception as e: except Exception as e:
# logger.error(f"发送异常: {e}") logger.error(f"发送异常: {e}")
# return False return False
async def batch_push_to_remote(data_list: List[Dict[str, Any]]) -> None: async def batch_push_to_remote(data_list: List[Dict[str, Any]]) -> None: