hard stuff
This commit is contained in:
parent
902ad0ea71
commit
3b8079ca87
@ -91,7 +91,7 @@ func (p *PeerCache) LaunchPeerExecution(peerID string, dataID string,
|
|||||||
url := ""
|
url := ""
|
||||||
|
|
||||||
// Check the status of the peer
|
// Check the status of the peer
|
||||||
if mypeer, ok := p.checkPeerStatus(peerID, dt.API(), caller); !ok {
|
if mypeer, ok := p.checkPeerStatus(peerID, dt.API(), caller); !ok && mypeer != nil {
|
||||||
// If the peer is not reachable, add the execution to the failed executions list
|
// If the peer is not reachable, add the execution to the failed executions list
|
||||||
pexec := &PeerExecution{
|
pexec := &PeerExecution{
|
||||||
Method: method.String(),
|
Method: method.String(),
|
||||||
@ -104,6 +104,9 @@ func (p *PeerCache) LaunchPeerExecution(peerID string, dataID string,
|
|||||||
mypeer.GetAccessor(nil).UpdateOne(mypeer, peerID) // Update the peer in the db
|
mypeer.GetAccessor(nil).UpdateOne(mypeer, peerID) // Update the peer in the db
|
||||||
return nil, errors.New("peer is not reachable")
|
return nil, errors.New("peer is not reachable")
|
||||||
} else {
|
} else {
|
||||||
|
if mypeer == nil {
|
||||||
|
return nil, errors.New("peer not found")
|
||||||
|
}
|
||||||
// If the peer is reachable, launch the execution
|
// If the peer is reachable, launch the execution
|
||||||
url = p.urlFormat((mypeer.Url)+meth, dt) // Format the URL
|
url = p.urlFormat((mypeer.Url)+meth, dt) // Format the URL
|
||||||
tmp := mypeer.FailedExecution // Get the failed executions list
|
tmp := mypeer.FailedExecution // Get the failed executions list
|
||||||
|
Loading…
Reference in New Issue
Block a user