Skip to content

Commit

Permalink
feat: CanAddPeerEdge is moved to the end of filter (#3036)
Browse files Browse the repository at this point in the history
Signed-off-by: Gaius <gaius.qi@gmail.com>
  • Loading branch information
gaius-qi authored Jan 19, 2024
1 parent 2f04697 commit a38a457
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions scheduler/scheduling/scheduling.go
Original file line number Diff line number Diff line change
Expand Up @@ -516,12 +516,6 @@ func (s *scheduling) filterCandidateParents(peer *resource.Peer, blocklist set.S
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,
// because dfdaemon cannot handle the situation
// where two tasks are downloading and downloading each other.
Expand Down Expand Up @@ -562,6 +556,12 @@ func (s *scheduling) filterCandidateParents(peer *resource.Peer, blocklist set.S
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)
candidateParentIDs = append(candidateParentIDs, candidateParent.ID)
}
Expand Down

0 comments on commit a38a457

Please sign in to comment.