No discovery needed
This commit is contained in:
parent
e4ee33dcbe
commit
2404ee3fce
@ -80,11 +80,11 @@ func (a *API) CheckRemotePeer(url string) (State, map[string]int) {
|
||||
return ToState(resp.Data.State), new
|
||||
}
|
||||
|
||||
func (a *API) CheckRemoteAPIs(urls []string) (State, map[string]int, error) {
|
||||
func (a *API) CheckRemoteAPIs(urls map[string]string) (State, map[string]int, error) {
|
||||
// Check if the database is up
|
||||
new := map[string]int{}
|
||||
caller := NewHTTPCaller(map[string]map[METHOD]string{})
|
||||
for _, url := range urls {
|
||||
for appName, url := range urls {
|
||||
var resp APIStatusResponse
|
||||
b, err := caller.CallGet(url, "/version/status")
|
||||
if err != nil {
|
||||
@ -94,9 +94,7 @@ func (a *API) CheckRemoteAPIs(urls []string) (State, map[string]int, error) {
|
||||
if resp.Data == nil {
|
||||
return DEAD, new, errors.New(url + " -> is DEAD")
|
||||
}
|
||||
for k, v := range resp.Data.Services {
|
||||
new[k] = ToState(v).EnumIndex()
|
||||
}
|
||||
new[appName] = ToState(resp.Data.State).EnumIndex()
|
||||
if resp.Data.Code != 0 {
|
||||
return REDUCED_SERVICE, new, errors.New(url + " -> " + resp.Error)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user