Booking trace API
This commit is contained in:
@@ -33,7 +33,19 @@ type PeerCache struct {
|
||||
}
|
||||
|
||||
func (p *PeerCache) checkPeerStatus(peerID string) bool {
|
||||
return true
|
||||
api := tools.API{}
|
||||
access := (&Peer{}).GetAccessor(nil)
|
||||
res, code, _ := access.LoadOne(peerID)
|
||||
if code != 200 {
|
||||
return false
|
||||
}
|
||||
url := res.(*Peer).Url
|
||||
if strings.Contains(url, "localhost") || strings.Contains(url, "127.0.0.1") {
|
||||
url = strings.ReplaceAll(url, "localhost", utils.PEER.API())
|
||||
|
||||
}
|
||||
state := api.CheckRemotePeer(url + ":8093")
|
||||
return state != tools.DEAD
|
||||
}
|
||||
|
||||
func (p *PeerCache) GetAccessor(caller *tools.HTTPCaller) utils.Accessor {
|
||||
|
||||
Reference in New Issue
Block a user