log who owns it
All checks were successful
Build and Publish / BuildAndDeployAmd64 (push) Successful in 27s
Build and Publish / BuildAndDeploy (push) Successful in 2m28s

This commit is contained in:
matst80
2024-11-12 19:43:19 +01:00
parent 7e0f070637
commit 1616c94f8f
2 changed files with 9 additions and 13 deletions

View File

@@ -128,7 +128,7 @@ func (p *SyncedPool) RemoveRemoteGrain(id CartId) {
func (p *SyncedPool) SpawnRemoteGrain(id CartId, host string) {
if p.local.grains[id] != nil {
log.Printf("Grain %s already exists locally, deleting\n", id)
log.Printf("Grain %s already exists locally, exists on (%s)\n", id, host)
p.mu.Lock()
delete(p.local.grains, id)
p.mu.Unlock()
@@ -395,18 +395,15 @@ func (p *SyncedPool) AddRemote(host string) error {
}()
go func() {
for range time.Tick(time.Second * 3) {
var err error
err := remote.Ping()
err = remote.Ping()
if err != nil {
for err != nil {
time.Sleep(time.Millisecond * 200)
err = remote.Ping()
if remote.MissedPings > 3 {
log.Printf("Removing host, unable to communicate with %s", host)
p.RemoveHost(&remote)
return
}
for err != nil {
time.Sleep(time.Millisecond * 200)
err = remote.Ping()
if remote.MissedPings > 3 {
log.Printf("Removing host, unable to communicate with %s", host)
p.RemoveHost(&remote)
return
}
}
}