added a log when an API is not reachable

This commit is contained in:
pb 2025-06-02 18:22:08 +02:00
parent 6ab6383144
commit 7b8aa989f6

View File

@ -5,6 +5,7 @@ import (
"errors"
"strings"
oclib "cloud.o-forge.io/core/oc-lib"
"cloud.o-forge.io/core/oc-lib/config"
"cloud.o-forge.io/core/oc-lib/dbs/mongo"
beego "github.com/beego/beego/v2/server/web"
@ -145,6 +146,8 @@ func (a *API) CheckRemoteAPIs(apis []DataType) (State, map[string]string, error)
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 {
l := oclib.GetLogger()
l.Error().Msg(api.String() + " not reachable")
state = REDUCED_SERVICE // If a remote API is not reachable, return reduced service
continue
}