This commit is contained in:
mr 2024-11-06 15:32:55 +01:00
parent 06e048165e
commit 828efb4c98

View File

@ -71,7 +71,8 @@ func (p *PeerCache) checkPeerStatus(peerID string, appName string, caller *tools
}
url := p.urlFormat(res.(*Peer).Url, tools.PEER) + meth // Format the URL
fmt.Println("Checking peer status on", url, "...")
state, services := api.CheckRemotePeer(url) // Check the status of the peer
state, services := api.CheckRemotePeer(url)
fmt.Println("Checking peer status on", url, state, services) // Check the status of the peer
res.(*Peer).Services = services // Update the services states of the peer
access.UpdateOne(res, peerID) // Update the peer in the db
return res.(*Peer), state != tools.DEAD && services[appName] == 0 // Return the peer and its status