Skip to content

Commit

Permalink
Check slots for direct workers
Browse files Browse the repository at this point in the history
  • Loading branch information
sergystepanov committed Nov 17, 2024
1 parent 1147aed commit f09500f
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions pkg/coordinator/hub.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package coordinator

import (
"bytes"
"encoding/base64"
"fmt"
"net/http"
Expand Down Expand Up @@ -299,16 +298,20 @@ func (h *Hub) findWorkerById(id string, useAllWorkers bool) *Worker {
if w.Id() == com.NilUid {
continue
}
if useAllWorkers {
if uid == w.Id() {
return w
}
} else {
// select any worker on the same machine when workers are grouped on the client
if bytes.Equal(uid.Machine(), w.Id().Machine()) {
return w
}

if uid == w.Id() && w.HasSlot() {
return w
}
//if useAllWorkers {
// if uid == w.Id() {
// return w
// }
//} else {
// // select any worker on the same machine when workers are grouped on the client
// if bytes.Equal(uid.Machine(), w.Id().Machine()) {
// return w
// }
//}
}

return nil
Expand Down

0 comments on commit f09500f

Please sign in to comment.