This commit is contained in:
@@ -111,11 +111,15 @@ func NewSyncedPool(local *GrainLocalPool, hostname string, d Discovery) (*Synced
|
|||||||
if h == hostname {
|
if h == hostname {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
found := false
|
||||||
for _, r := range pool.remotes {
|
for _, r := range pool.remotes {
|
||||||
if r.Host == h {
|
if r.Host == h {
|
||||||
continue
|
found = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if found {
|
||||||
|
continue
|
||||||
|
}
|
||||||
err := pool.AddRemote(h)
|
err := pool.AddRemote(h)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("Error adding undiscovered remote %s: %v\n", h, err)
|
log.Printf("Error adding undiscovered remote %s: %v\n", h, err)
|
||||||
@@ -224,6 +228,7 @@ func (p *SyncedPool) handleConnection(conn net.Conn) {
|
|||||||
|
|
||||||
if !found {
|
if !found {
|
||||||
log.Printf("Remote host %s not found\n", idAndHostParts[1])
|
log.Printf("Remote host %s not found\n", idAndHostParts[1])
|
||||||
|
log.Printf("Remotes %v\n", p.remotes)
|
||||||
SendPacket(conn, AckError, func(w io.Writer) error {
|
SendPacket(conn, AckError, func(w io.Writer) error {
|
||||||
w.Write([]byte("remote host not found"))
|
w.Write([]byte("remote host not found"))
|
||||||
return nil
|
return nil
|
||||||
|
|||||||
Reference in New Issue
Block a user