MCPcopy Create free account
hub / github.com/PaddlePaddle/FastDeploy / tail_file

Function tail_file

tests/ce/deploy/deploy.py:484–489  ·  view source on GitHub ↗
(path, lines=50)

Source from the content-addressed store, hash-verified

482 if elapsed >= timeout:
483
484 def tail_file(path, lines=50):
485 try:
486 with open(path, "r", encoding="utf-8", errors="ignore") as f:
487 return "".join(f.readlines()[-lines:])
488 except Exception as e:
489 return f"[无法读取 {path}]: {e}, {str(traceback.format_exc())}\n"
490
491 result = f"服务启动超时,耗时:[{timeout}s]\n\n"
492 result += "==== server.log tail 50 ====\n"

Callers 1

generateFunction · 0.85

Calls 1

joinMethod · 0.80

Tested by

no test coverage detected