部署线上5090时候的改动git commit -m 部署线上5090时候的改动。

This commit is contained in:
xsl
2026-07-16 07:54:07 +08:00
parent 12f34c44f2
commit 0f8a7e27c0
4 changed files with 572 additions and 4 deletions
+6 -2
View File
@@ -1682,13 +1682,17 @@ async def hairline_grow_v2_final_v2(
@app.get("/api/v1/debug/hairline_log", include_in_schema=False)
async def download_hairline_log(rid: Optional[str] = None, tail: int = 500):
"""返回 /home/xsl/hair/log/hairline_grow.log 的内容。
"""返回 <仓库根>/log/hairline_grow.log 的内容。
rid 非空时只返回该 request id 相关的行;tail 限制返回最后 N 行(默认 500)。
供调试页"下载日志"按钮调用。
"""
from fastapi.responses import PlainTextResponse
log_path = "/home/xsl/hair/log/hairline_grow.log"
log_path = os.getenv(
"HAIR_LOG_DIR",
os.path.join(os.path.dirname(os.path.abspath(__file__)), "log"),
)
log_path = os.path.join(log_path, "hairline_grow.log")
try:
with open(log_path, encoding="utf-8") as fh:
lines = fh.readlines()