From 56bcb89d3d6c3109440e39ddfc764be5a48e71a7 Mon Sep 17 00:00:00 2001 From: "2569718930@qq.com" <2569718930@qq.com> Date: Wed, 20 May 2026 12:07:35 +0800 Subject: [PATCH] =?UTF-8?q?@=20=E7=A7=BB=E9=99=A4=20OpenWeather=20/=20Visu?= =?UTF-8?q?alCrossing=20=E5=81=A5=E5=BA=B7=E6=A3=80=E6=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 两个数据源有实现但从未在主流程中被调用,属于死代码 @ --- .../ops/health/HealthPageClient.tsx | 2 -- web/services/ops_api.py | 24 ------------------- 2 files changed, 26 deletions(-) diff --git a/frontend/components/ops/health/HealthPageClient.tsx b/frontend/components/ops/health/HealthPageClient.tsx index 78f7d812..adef0e6d 100644 --- a/frontend/components/ops/health/HealthPageClient.tsx +++ b/frontend/components/ops/health/HealthPageClient.tsx @@ -32,8 +32,6 @@ const LABELS: Record = { synoptic: "Synoptic Data", amos: "AMOS (韩国跑道)", amsc_awos: "AMSC AWOS (中国)", - openweather: "OpenWeather", - visualcrossing: "VisualCrossing", noaa_wrh: "NOAA WRH (美国结算)", }; diff --git a/web/services/ops_api.py b/web/services/ops_api.py index 15c3b4db..77e43286 100644 --- a/web/services/ops_api.py +++ b/web/services/ops_api.py @@ -759,30 +759,6 @@ def get_ops_health_check(request: Request) -> dict[str, Any]: else: results["amsc_awos"] = {"ok": False, "error": "not configured"} - # OpenWeather - ow_key = str(os.getenv("OPENWEATHER_API_KEY") or "").strip() - if ow_key: - try: - t0 = _time.perf_counter() - r = _r.get(f"https://api.openweathermap.org/data/2.5/weather?q=London&appid={ow_key}", timeout=timeout) - results["openweather"] = {"ok": r.ok, "status": r.status_code, "latency_ms": round((_time.perf_counter() - t0) * 1000)} - except Exception as e: - results["openweather"] = {"ok": False, "error": str(e)[:100]} - else: - results["openweather"] = {"ok": False, "error": "not configured"} - - # VisualCrossing - vc_key = str(os.getenv("VISUALCROSSING_API_KEY") or "").strip() - if vc_key: - try: - t0 = _time.perf_counter() - r = _r.get(f"https://weather.visualcrossing.com/VisualCrossingWebServices/rest/services/timeline/London/today?key={vc_key}&include=current", timeout=timeout) - results["visualcrossing"] = {"ok": r.ok, "status": r.status_code, "latency_ms": round((_time.perf_counter() - t0) * 1000)} - except Exception as e: - results["visualcrossing"] = {"ok": False, "error": str(e)[:100]} - else: - results["visualcrossing"] = {"ok": False, "error": "not configured"} - # NOAA WRH (US settlement verification) try: t0 = _time.perf_counter()