feat: CanAddPeerEdge is moved to the end of filter (#3036)
Signed-off-by: Gaius <gaius.qi@gmail.com>
This commit is contained in:
parent
2f04697d14
commit
a38a4578c3
|
|
@ -516,12 +516,6 @@ func (s *scheduling) filterCandidateParents(peer *resource.Peer, blocklist set.S
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
// Candidate parent can add edge with peer.
|
|
||||||
if !peer.Task.CanAddPeerEdge(candidateParent.ID, peer.ID) {
|
|
||||||
peer.Log.Debugf("can not add edge with parent %s", candidateParent.ID)
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
// Candidate parent host is not allowed to be the same as the peer host,
|
// Candidate parent host is not allowed to be the same as the peer host,
|
||||||
// because dfdaemon cannot handle the situation
|
// because dfdaemon cannot handle the situation
|
||||||
// where two tasks are downloading and downloading each other.
|
// where two tasks are downloading and downloading each other.
|
||||||
|
|
@ -562,6 +556,12 @@ func (s *scheduling) filterCandidateParents(peer *resource.Peer, blocklist set.S
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Candidate parent can add edge with peer.
|
||||||
|
if !peer.Task.CanAddPeerEdge(candidateParent.ID, peer.ID) {
|
||||||
|
peer.Log.Debugf("can not add edge with parent %s", candidateParent.ID)
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
candidateParents = append(candidateParents, candidateParent)
|
candidateParents = append(candidateParents, candidateParent)
|
||||||
candidateParentIDs = append(candidateParentIDs, candidateParent.ID)
|
candidateParentIDs = append(candidateParentIDs, candidateParent.ID)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue