AMSC 请求添加调试日志,排查 SSL verify 状态
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user