removed caller from checkPeerStatus() parameters by adding the path to url
This commit is contained in:
parent
d4f000466f
commit
18c723ee42
@ -48,7 +48,7 @@ func (p *PeerCache) urlFormat(hostUrl string, dt tools.DataType) string {
|
||||
hostUrl = strings.ReplaceAll(hostUrl, localhost, dt.API()+":8080/oc")
|
||||
}
|
||||
} else {
|
||||
hostUrl = dt.API() + "/" + hostUrl
|
||||
hostUrl = hostUrl + "/" + strings.ReplaceAll(dt.API(), "oc-", "")
|
||||
}
|
||||
fmt.Println("Host URL : ", hostUrl)
|
||||
return hostUrl
|
||||
@ -66,9 +66,6 @@ func (p *PeerCache) checkPeerStatus(peerID string, appName string) (*Peer, bool)
|
||||
state, services := api.CheckRemotePeer(url)
|
||||
res.(*Peer).ServicesState = services // Update the services states of the peer
|
||||
access.UpdateOne(res, peerID) // Update the peer in the db
|
||||
fmt.Println("URL peer : ", url)
|
||||
fmt.Println("State : ", state)
|
||||
fmt.Println("Services : ", services)
|
||||
return res.(*Peer), state != tools.DEAD && services[appName] == 0 // Return the peer and its status
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user