diff --git a/sched.go b/sched.go index 9a60a415f..fb689663a 100644 --- a/sched.go +++ b/sched.go @@ -117,7 +117,8 @@ func (m *Manager) maybeSchedRequest(req *workerRequest) (*workerResponse, error) tried := 0 - for _, id := range req.accept { + for i := len(req.accept) - 1; i >= 0; i-- { + id := req.accept[i] w, ok := m.workers[id] if !ok { log.Warnf("requested worker %d is not in scheduler", id)