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

Function tle_status

backend/api.py:1231–1253  ·  view source on GitHub ↗

查看本地 TLE 缓存的新鲜度与条目统计。 响应示例:: {"code": 0, "data": { "cache_dir": "/path/to/data/tle_cache", "total_groups": 3, "total_tles": 18000, "entries": [ {"group": "starlink", "fetched_at": "...", "age_seconds": 300,

()

Source from the content-addressed store, hash-verified

1229
1230@app.route('/api/tle/status', methods=['GET'])
1231def tle_status():
1232 """查看本地 TLE 缓存的新鲜度与条目统计。
1233
1234 响应示例::
1235
1236 {"code": 0, "data": {
1237 "cache_dir": "/path/to/data/tle_cache",
1238 "total_groups": 3,
1239 "total_tles": 18000,
1240 "entries": [
1241 {"group": "starlink", "fetched_at": "...", "age_seconds": 300,
1242 "is_fresh": true, "entry_count": 6000}
1243 ],
1244 "supported_groups": [...]
1245 }}
1246 """
1247 try:
1248 status = get_cache_status()
1249 status["supported_groups"] = SUPPORTED_GROUPS
1250 return ok(status)
1251 except Exception:
1252 logger.exception("TLE 状态查询失败")
1253 return error_response("INTERNAL_ERROR")
1254
1255
1256# ==========================================

Callers

nothing calls this directly

Calls 3

get_cache_statusFunction · 0.90
okFunction · 0.90
error_responseFunction · 0.90

Tested by

no test coverage detected