diff --git a/core/alarm_upload_worker.py b/core/alarm_upload_worker.py index c473a96..0af1bd6 100644 --- a/core/alarm_upload_worker.py +++ b/core/alarm_upload_worker.py @@ -107,7 +107,7 @@ class AlarmUploadWorker: self._logger.info(f"告警上报端点: {report_url}") try: - resp = requests.get(health_url, timeout=5) + resp = requests.get(health_url, timeout=5, proxies={"http": None, "https": None}) if resp.status_code == 200: self._logger.info(f"云端健康检查通过: {health_url}") else: @@ -247,7 +247,8 @@ class AlarmUploadWorker: } try: - response = requests.post(url, json=payload, headers=headers, timeout=10) + response = requests.post(url, json=payload, headers=headers, timeout=10, + proxies={"http": None, "https": None}) if response.status_code == 200: body = response.json() if body.get("code") == 0: @@ -346,6 +347,7 @@ class AlarmUploadWorker: json=report_data, headers=headers, timeout=10, + proxies={"http": None, "https": None}, ) if response.status_code == 200: diff --git a/main.py b/main.py index 0671685..c4dd923 100644 --- a/main.py +++ b/main.py @@ -323,7 +323,8 @@ class EdgeInferenceService: for url in urls: try: - resp = requests.post(url, json=payload, timeout=10) + resp = requests.post(url, json=payload, timeout=10, + proxies={"http": None, "https": None}) if resp.status_code == 200: self._logger.debug(f"[心跳] {url} 上报成功") else: