Skip to content

Commit

Permalink
microcloud/cmd: fix timeout issue
Browse files Browse the repository at this point in the history
In case of mDNS discovery issue (no IPv6 support on a node for example),
the timeout never seems to occur leading to wait forever. This should fix the issue

Signed-off-by: Gabriel Mougard <[email protected]>
  • Loading branch information
gabrielmougard committed Jan 2, 2024
1 parent a242d1a commit a1a9559
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions microcloud/cmd/microcloud/main_init.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,14 +179,12 @@ func lookupPeers(s *service.Handler, autoSetup bool, iface *net.Interface, subne
}()
}

var timeAfter <-chan time.Time
timeoutDuration := time.Minute
if autoSetup {
timeAfter = time.After(5 * time.Second)
timeoutDuration = 5 * time.Second
}

if len(expectedSystems) > 0 {
timeAfter = time.After(1 * time.Minute)
}
timeAfter := time.After(timeoutDuration)

expectedSystemsMap := make(map[string]bool, len(expectedSystems))
for _, system := range expectedSystems {
Expand Down

0 comments on commit a1a9559

Please sign in to comment.