Skip to content

Commit

Permalink
updates internet connection test (#1919)
Browse files Browse the repository at this point in the history
  • Loading branch information
MarioBassem authored Mar 8, 2023
1 parent e889067 commit 2e87481
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions cmds/internet/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,10 @@ func main() {
}

func check() error {
retries := 0
f := func() error {
cmd := exec.Command("wget", "google.com", "-O", "/dev/null", "-T", "5")
retries += 1
cmd := exec.Command("wget", "bootstrap.grid.tf", "-O", "/dev/null", "-T", "5")
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr

Expand All @@ -63,7 +65,10 @@ func check() error {

errHandler := func(err error, t time.Duration) {
if err != nil {
log.Error().Err(err).Msg("error while trying to test internet connectivity")
log.Info().Msg("internet connection is not ready yet")
if retries%10 == 0 {
log.Error().Err(err).Msgf("error while trying to test internet connectivity. %d retries attempted", retries)
}
}
}

Expand Down

0 comments on commit 2e87481

Please sign in to comment.