修复:所有HTTP请求禁用系统代理,解决本机Clash代理导致心跳和告警上报超时
This commit is contained in:
@@ -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:
|
||||
|
||||
3
main.py
3
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:
|
||||
|
||||
Reference in New Issue
Block a user