Use 5s backoff with 1m timeout fetching .drone.yml

This commit is contained in:
Brad Rydzewski 2017-11-28 11:36:22 -08:00 committed by GitHub
parent 956418cae9
commit 6397395570
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -103,12 +103,12 @@ func Perm(c context.Context, u *model.User, owner, repo string) (*model.Perm, er
// File fetches a file from the remote repository and returns in string format. // File fetches a file from the remote repository and returns in string format.
func File(c context.Context, u *model.User, r *model.Repo, b *model.Build, f string) (out []byte, err error) { func File(c context.Context, u *model.User, r *model.Repo, b *model.Build, f string) (out []byte, err error) {
for i := 0; i < 5; i++ { for i := 0; i < 12; i++ {
out, err = FromContext(c).File(u, r, b, f) out, err = FromContext(c).File(u, r, b, f)
if err == nil { if err == nil {
return return
} }
time.Sleep(1 * time.Second) time.Sleep(5 * time.Second)
} }
return return
} }