From fd730741a42473ccca3bd11140cefd0dd8881c7e Mon Sep 17 00:00:00 2001 From: mr Date: Fri, 23 Aug 2024 17:35:29 +0200 Subject: [PATCH] simplify call to peer --- tools/api.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/api.go b/tools/api.go index 6991acf..ec27a18 100644 --- a/tools/api.go +++ b/tools/api.go @@ -3,6 +3,7 @@ package tools import ( "encoding/json" "errors" + "fmt" "cloud.o-forge.io/core/oc-lib/dbs/mongo" ) @@ -66,14 +67,17 @@ func (a *API) CheckRemotePeer(url string) (State, map[string]int) { caller := NewHTTPCaller(map[string]map[METHOD]string{}) var resp APIStatusResponse b, err := caller.CallPost(url, "/status", []string{}) + fmt.Println("CheckRemotePeer", b, err) if err != nil { return DEAD, map[string]int{} } json.Unmarshal(b, &resp) + fmt.Println("CheckRemotePeer2", b, err) if resp.Data == nil { return DEAD, map[string]int{} } new := map[string]int{} + fmt.Println("CheckRemotePeer", resp.Data.Services) for k, v := range resp.Data.Services { new[k] = ToState(v).EnumIndex() }