MCPcopy Create free account
hub / github.com/Tong89/smartNode / get_debug_status

Function get_debug_status

backend/api.py:133–147  ·  view source on GitHub ↗

获取调试状态 - 仅在显式开启 SMARTNODE_DEBUG_API 时可用,默认返回 404。

()

Source from the content-addressed store, hash-verified

131
132@app.route('/api/debug_status')
133def get_debug_status():
134 """获取调试状态 - 仅在显式开启 SMARTNODE_DEBUG_API 时可用,默认返回 404。"""
135 if not debug_api_enabled():
136 return error_response("NOT_FOUND")
137 # 仅返回脱敏运行摘要,不暴露线程对象等实现细节
138 thread_alive = bool(
139 simulation_engine.simulation_thread and simulation_engine.simulation_thread.is_alive()
140 )
141 return ok({
142 "simulation_running": simulation_engine.running,
143 "simulation_thread_alive": thread_alive,
144 "current_time": round(simulation_engine.current_time, 2),
145 "active_requests": len(simulation_engine.transmission_requests),
146 "history_count": len(simulation_engine.request_history),
147 })
148
149
150@app.route('/api/request', methods=['POST'])

Callers

nothing calls this directly

Calls 3

debug_api_enabledFunction · 0.90
error_responseFunction · 0.90
okFunction · 0.90

Tested by

no test coverage detected