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

Function service_status

tests/ce/deploy/deploy.py:378–395  ·  view source on GitHub ↗

检查服务状态

()

Source from the content-addressed store, hash-verified

376
377@app.route("/status", methods=["GET", "POST"])
378def service_status():
379 """检查服务状态"""
380 health, msg = is_server_running()
381
382 if not health:
383 return Response(json.dumps(msg, ensure_ascii=False), status=500, content_type="application/json")
384
385 # 检查端口是否监听
386 ports_status = {
387 "api_port": FD_API_PORT if is_port_in_use(FD_API_PORT) else None,
388 "queue_port": FD_ENGINE_QUEUE_PORT if is_port_in_use(FD_ENGINE_QUEUE_PORT) else None,
389 "metrics_port": FD_METRICS_PORT if is_port_in_use(FD_METRICS_PORT) else None,
390 }
391
392 msg["status"] = "服务启动完成"
393 msg["ports_status"] = ports_status
394
395 return Response(json.dumps(msg, ensure_ascii=False), status=200, content_type="application/json")
396
397
398@app.route("/stop", methods=["POST"])

Callers

nothing calls this directly

Calls 2

is_server_runningFunction · 0.85
is_port_in_useFunction · 0.85

Tested by

no test coverage detected