|
@@ -78,6 +78,10 @@ def _upload_chunk(text: str, query: str, channel: str = "", max_retries: int = 3
|
|
|
# 以 GET 方法发送,body 为 JSON 字符串
|
|
|
body = json.dumps(payload, ensure_ascii=False).encode('utf-8')
|
|
|
resp = requests.post(CHUNK_API_URL, headers=headers, data=body, timeout=30)
|
|
|
+ try:
|
|
|
+ logger.info(f"上传chunk成功: resp={resp.json()}")
|
|
|
+ except Exception:
|
|
|
+ logger.info(f"上传chunk返回非JSON: text={resp.text[:500]}")
|
|
|
if resp.json().get("doc_id"):
|
|
|
return True
|
|
|
logger.warning(f"上传失败,状态码: {resp.status_code}, 第{attempt+1}次重试")
|