mirror of
https://github.com/giongto35/cloud-game.git
synced 2026-07-21 00:59:22 +00:00
Allow only available workers
This commit is contained in:
parent
9ad3c98a7d
commit
76c66339aa
1 changed files with 2 additions and 2 deletions
|
|
@ -189,7 +189,7 @@ func (s *Server) WS(w http.ResponseWriter, r *http.Request) {
|
|||
if workerId != "" {
|
||||
if xid_, err := xid.FromString(workerId); err == nil {
|
||||
if s.cfg.Coordinator.Debug {
|
||||
for _, w := range s.workerClients {
|
||||
for _, w := range s.getAvailableWorkers() {
|
||||
if xid_ == w.Id {
|
||||
wc = w
|
||||
bc.Printf("[!] Worker found: %v", xid_)
|
||||
|
|
@ -197,7 +197,7 @@ func (s *Server) WS(w http.ResponseWriter, r *http.Request) {
|
|||
}
|
||||
}
|
||||
} else {
|
||||
for _, w := range s.workerClients {
|
||||
for _, w := range s.getAvailableWorkers() {
|
||||
if bytes.Equal(xid_.Machine(), w.Id.Machine()) {
|
||||
wc = w
|
||||
bc.Printf("[!] Machine %v found: %v", xid_.Machine(), xid_)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue