Skip to content

Commit

Permalink
fix:修复timeout类型转换错误的bug
Browse files Browse the repository at this point in the history
  • Loading branch information
mouday committed Feb 1, 2024
1 parent 018861d commit 2e79146
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion domain_admin/router/api_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
10 changes: 5 additions & 5 deletions domain_admin/service/monitor_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 2e79146

Please sign in to comment.