mirror of
https://github.com/yusing/godoxy.git
synced 2026-03-20 08:35:11 +01:00
refactor: simplify health monitor code
This commit is contained in:
@@ -44,7 +44,7 @@ func CheckHealth(w http.ResponseWriter, r *http.Request) {
|
||||
http.Error(w, http.StatusText(http.StatusBadRequest), http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
result, err = monitor.NewHTTPHealthChecker(types.NewURL(&url.URL{
|
||||
result, err = monitor.NewHTTPHealthMonitor(types.NewURL(&url.URL{
|
||||
Scheme: scheme,
|
||||
Host: host,
|
||||
Path: path,
|
||||
@@ -63,7 +63,7 @@ func CheckHealth(w http.ResponseWriter, r *http.Request) {
|
||||
http.Error(w, http.StatusText(http.StatusBadRequest), http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
result, err = monitor.NewRawHealthChecker(types.NewURL(&url.URL{
|
||||
result, err = monitor.NewRawHealthMonitor(types.NewURL(&url.URL{
|
||||
Scheme: scheme,
|
||||
Host: host,
|
||||
}), defaultHealthConfig).CheckHealth()
|
||||
|
||||
Reference in New Issue
Block a user