This commit is contained in:
mr 2024-10-07 08:44:34 +02:00
parent c083ce748c
commit 6dfd6058ef

View File

@ -60,7 +60,8 @@ func (p *PeerCache) checkPeerStatus(peerID string, appName string, caller *tools
if meth == "" {
return res.(*Peer), false
}
url := p.urlFormat(res.(*Peer).Url+meth, tools.PEER) // Format the URL
url := p.urlFormat(res.(*Peer).Url+meth, tools.PEER) // Format the URL
fmt.Println("Checking peer status on", url, "...")
state, services := api.CheckRemotePeer(url) // 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
@ -109,6 +110,7 @@ func (p *PeerCache) LaunchPeerExecution(peerID string, dataID string,
// exec executes the method on the peer
func (p *PeerCache) exec(url string, method tools.METHOD, body map[string]interface{}, caller *tools.HTTPCaller) error {
fmt.Println("exec", url, "...")
var b []byte
var err error
if method == tools.POST { // Execute the POST method if it's a POST method