sync
All checks were successful
Build and Publish / BuildAndDeploy (push) Successful in 1m46s

This commit is contained in:
matst80
2024-11-09 19:38:05 +01:00
parent a56570bc09
commit 4c5c66e7ed

View File

@@ -97,11 +97,30 @@ func NewSyncedPool(local *GrainLocalPool, hostname string, d Discovery) (*Synced
continue
}
log.Printf("Discovered host %s\n", h)
err := pool.AddRemote(h)
if err != nil {
log.Printf("Error adding remote %s: %v\n", h, err)
}
}
otherHosts, err := pool.Negotiate(hosts)
if err != nil {
log.Printf("Error negotiating: %v\n", err)
}
for _, h := range otherHosts {
if h == hostname {
continue
}
for _, r := range pool.remotes {
if r.Host == h {
continue
}
}
err := pool.AddRemote(h)
if err != nil {
log.Printf("Error adding undiscovered remote %s: %v\n", h, err)
}
}
}()
}
go func() {