From 2e791468dcb0b6c4e6b90092f6525dddf21b9bdd Mon Sep 17 00:00:00 2001 From: pengshiyu <1940607002@qq.com> Date: Thu, 1 Feb 2024 22:54:10 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E4=BF=AE=E5=A4=8Dtimeout=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E8=BD=AC=E6=8D=A2=E9=94=99=E8=AF=AF=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- domain_admin/router/api_map.py | 2 +- domain_admin/service/monitor_service.py | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/domain_admin/router/api_map.py b/domain_admin/router/api_map.py index 4671ef9d67..ba1d8302af 100644 --- a/domain_admin/router/api_map.py +++ b/domain_admin/router/api_map.py @@ -181,7 +181,7 @@ # http监控 '/api/addMonitor': monitor_api.add_monitor, '/api/updateMonitorById': monitor_api.update_monitor_by_id, - '/api/addMonitorActive': monitor_api.update_monitor_active, + '/api/updateMonitorActive': monitor_api.update_monitor_active, '/api/removeMonitorById': monitor_api.remove_monitor_by_id, '/api/getMonitorById': monitor_api.get_monitor_by_id, '/api/getMonitorList': monitor_api.get_monitor_list, diff --git a/domain_admin/service/monitor_service.py b/domain_admin/service/monitor_service.py index 8a621b5256..69fb858dcd 100644 --- a/domain_admin/service/monitor_service.py +++ b/domain_admin/service/monitor_service.py @@ -117,14 +117,14 @@ def run_monitor(monitor_row): :return: """ if monitor_row.monitor_type == MonitorTypeEnum.HTTP: - run_http_monitor(monitor_row) + run_http_monitor(monitor_row.content_dict) -def run_http_monitor(monitor_row): +def run_http_monitor(content_dict): res = requests.request( - method=monitor_row.content_dict['method'], - url=monitor_row.content_dict['url'], - timeout=monitor_row.content_dict['timeout'], + method=content_dict['method'], + url=content_dict['url'], + timeout=int(content_dict['timeout']) ) if not res.ok: