From 5b3779e4cb21552ac3a2d5b5a9c1ced9b399f585 Mon Sep 17 00:00:00 2001 From: mr Date: Fri, 23 Aug 2024 11:13:01 +0200 Subject: [PATCH] simplify call to peer --- tools/api.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/api.go b/tools/api.go index 71cf88c..1add8e0 100644 --- a/tools/api.go +++ b/tools/api.go @@ -80,9 +80,9 @@ func (a *API) CheckRemotePeer(url string) (State, map[string]int) { return ToState(resp.Data.State), new } -func (a *API) CheckRemoteAPIs(urls map[string]string) (State, map[string]int, error) { +func (a *API) CheckRemoteAPIs(urls map[string]string) (State, map[string]string, error) { // Check if the database is up - new := map[string]int{} + new := map[string]string{} caller := NewHTTPCaller(map[string]map[METHOD]string{}) for appName, url := range urls { var resp APIStatusResponse @@ -94,7 +94,7 @@ func (a *API) CheckRemoteAPIs(urls map[string]string) (State, map[string]int, er if resp.Data == nil { return DEAD, new, errors.New(url + " -> is DEAD") } - new[appName] = ToState(resp.Data.State).EnumIndex() + new[appName] = resp.Data.State if resp.Data.Code != 0 { return REDUCED_SERVICE, new, errors.New(url + " -> " + resp.Error) }