diff --git a/bootstrap.go b/bootstrap.go index fa41b6f..c792324 100644 --- a/bootstrap.go +++ b/bootstrap.go @@ -8,6 +8,7 @@ import ( "os" "path/filepath" "strings" + "time" "github.com/rs/zerolog/log" @@ -45,9 +46,18 @@ func bootstrap(cfg *config.Config) { bootstrapFile := filepath.Join(baseDir, "bootstrap.tar") err = func() (err error) { - resp, err := http.Get(seed) + var resp *http.Response + + start := time.Now() + for time.Since(start) <= time.Minute { + resp, err = http.Get(seed) + if err == nil { + break + } + time.Sleep(time.Second) + } if err != nil { - return + return fmt.Errorf("failed to fetch bootstrap") } if resp.StatusCode != http.StatusOK {