获取调试状态 - 仅在显式开启 SMARTNODE_DEBUG_API 时可用,默认返回 404。
()
| 131 | |
| 132 | @app.route('/api/debug_status') |
| 133 | def 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']) |
nothing calls this directly
no test coverage detected