This commit is contained in:
@@ -51,8 +51,8 @@ func NewSyncedPool(local *GrainLocalPool, hostname string, d Discovery) (*Synced
|
||||
remotes: make([]*RemoteHost, 0),
|
||||
remoteIndex: make(map[CartId]*RemoteGrainPool),
|
||||
}
|
||||
pingTimer := time.NewTicker(time.Second)
|
||||
go func() {
|
||||
|
||||
go func(pingTimer *time.Ticker) {
|
||||
for {
|
||||
<-pingTimer.C
|
||||
log.Printf("Pinging remotes %d\n", len(pool.remotes))
|
||||
@@ -73,10 +73,9 @@ func NewSyncedPool(local *GrainLocalPool, hostname string, d Discovery) (*Synced
|
||||
}
|
||||
connectedRemotes.Set(float64(len(pool.remotes)))
|
||||
}
|
||||
}()
|
||||
}(time.NewTicker(time.Second))
|
||||
if d != nil {
|
||||
discoveryTimer := time.NewTicker(time.Second * 5)
|
||||
go func() {
|
||||
go func(discoveryTimer *time.Ticker) {
|
||||
<-discoveryTimer.C
|
||||
log.Printf("Looking for new nodes\n")
|
||||
hosts, err := d.Discover()
|
||||
@@ -117,7 +116,7 @@ func NewSyncedPool(local *GrainLocalPool, hostname string, d Discovery) (*Synced
|
||||
}
|
||||
}
|
||||
|
||||
}()
|
||||
}(time.NewTicker(time.Second * 5))
|
||||
}
|
||||
go func() {
|
||||
for {
|
||||
|
||||
Reference in New Issue
Block a user