From 9ae5f3b91d0657ec19ea81fde0b2e770c0f5c70c Mon Sep 17 00:00:00 2001 From: pb Date: Wed, 28 May 2025 18:19:07 +0200 Subject: [PATCH] timing status checks --- tools/api.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/api.go b/tools/api.go index e213ecd..1375970 100644 --- a/tools/api.go +++ b/tools/api.go @@ -7,6 +7,7 @@ import ( "cloud.o-forge.io/core/oc-lib/config" "cloud.o-forge.io/core/oc-lib/dbs/mongo" + "cloud.o-forge.io/core/oc-lib/logs" beego "github.com/beego/beego/v2/server/web" ) @@ -134,6 +135,8 @@ func (a *API) CheckRemotePeer(url string) (State, map[string]int) { // CheckRemoteAPIs checks the state of remote APIs from your proper OC func (a *API) CheckRemoteAPIs(apis []DataType) (State, map[string]string, error) { + l := logs.GetLogger() + l.Debug().Msg("Start checking") // Check if the database is up new := map[string]string{} caller := NewHTTPCaller(map[DataType]map[METHOD]string{}) // Create a new http caller @@ -142,6 +145,7 @@ func (a *API) CheckRemoteAPIs(apis []DataType) (State, map[string]string, error) state := ALIVE reachable := false for _, api := range apis { // Check the state of each remote API in the list + l.Debug().Msg("Checking : " + api.String()) var resp APIStatusResponse b, err := caller.CallGet("http://"+api.API()+":8080", "/oc/version/status") // Call the status endpoint of the remote API (standard OC status endpoint) if err != nil {