diff --git a/models/peer/peer_cache.go b/models/peer/peer_cache.go index b990a98..4cb3dea 100644 --- a/models/peer/peer_cache.go +++ b/models/peer/peer_cache.go @@ -93,6 +93,7 @@ func (p *PeerCache) LaunchPeerExecution(peerID string, dataID string, } if mypeer, ok := p.checkPeerStatus(peerID, caller); !ok { mypeer.AddExecution(*pexec) + mypeer.GetAccessor(nil).UpdateOne(mypeer, peerID) return nil, errors.New("peer is not reachable") } else { url = p.urlFormat((mypeer.Url)+meth, dt) @@ -102,6 +103,7 @@ func (p *PeerCache) LaunchPeerExecution(peerID string, dataID string, tmp = append(tmp, v) } mypeer.FailedExecution = []PeerExecution{} + mypeer.GetAccessor(nil).UpdateOne(mypeer, peerID) for _, v := range tmp { go p.LaunchPeerExecution(peerID, v.DataID, utils.DataType(v.DataType), tools.ToMethod(v.Method), v.Body, caller) }