fix: 移除 push_to_remote 的 print(data),避免日志撑爆磁盘
每条 job 含 base_data 几十KB,全量 print 到 stdout 导致 Docker json-file 日志无限增长(930GB+)
This commit is contained in:
parent
f77c010330
commit
20cb35fc6e
@ -59,20 +59,18 @@ async def push_to_remote(data: Dict[str, Any]) -> bool:
|
||||
source_type = data.get("source_type", "未知平台")
|
||||
title = data.get("title", "未知职位")
|
||||
company = data.get("company_name", data.get("name", "未知公司"))
|
||||
logger.info(f"上报数据: [{source_type}] {title} - {company}")
|
||||
print(data)
|
||||
|
||||
# try:
|
||||
# url = _build_auth_url()
|
||||
# client = get_http_client()
|
||||
# response = await client.post(url, json=data, headers=_PUSH_HEADERS)
|
||||
# if response.status_code == 200:
|
||||
# return True
|
||||
# logger.error(f"数据发送失败: {response.status_code} - {response.text[:100]}")
|
||||
# return False
|
||||
# except Exception as e:
|
||||
# logger.error(f"发送异常: {e}")
|
||||
# return False
|
||||
try:
|
||||
url = _build_auth_url()
|
||||
client = get_http_client()
|
||||
response = await client.post(url, json=data, headers=_PUSH_HEADERS)
|
||||
if response.status_code == 200:
|
||||
return True
|
||||
logger.error(f"数据发送失败: {response.status_code} - {response.text[:100]}")
|
||||
return False
|
||||
except Exception as e:
|
||||
logger.error(f"发送异常: {e}")
|
||||
return False
|
||||
|
||||
|
||||
async def batch_push_to_remote(data_list: List[Dict[str, Any]]) -> None:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user