1
0
mirror of https://github.com/woodpecker-ci/woodpecker.git synced 2025-01-17 17:45:03 +02:00

Merge pull request #1885 from bradrydzewski/master

added backoff to fetch yaml file
This commit is contained in:
Brad Rydzewski 2016-12-14 00:53:11 -05:00 committed by GitHub
commit b83a719e37

View File

@ -4,6 +4,7 @@ package remote
import (
"net/http"
"time"
"github.com/drone/drone/model"
@ -107,8 +108,15 @@ 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.
func File(c context.Context, u *model.User, r *model.Repo, b *model.Build, f string) ([]byte, error) {
return FromContext(c).File(u, r, b, f)
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++ {
out, err = FromContext(c).File(u, r, b, f)
if err == nil {
return
}
time.Sleep(1*time.Second)
}
return
}
// Status sends the commit status to the remote system.