AMSC 请求添加调试日志,排查 SSL verify 状态

This commit is contained in:
2569718930@qq.com
2026-05-15 03:03:26 +08:00
parent 00400f1392
commit 06df0a87dd
+1
View File
@@ -192,6 +192,7 @@ class AmscAwosSourceMixin:
def _http_get_json(self, url: str, *, headers: Optional[Dict[str, str]] = None) -> Optional[Dict[str, Any]]:
verify = os.getenv("POLYWEATHER_AMSC_SSL_VERIFY", "true").strip().lower() not in {"0", "false", "no"}
logger.info("AMSC AWOS _http_get_json verify={} url={}", verify, str(url)[:80])
with httpx.Client(verify=verify) as client:
response = client.get(url, headers=headers, timeout=getattr(self, "timeout", 10.0))
response.raise_for_status()