Merge pull request #2142 from bradrydzewski/master

fix issue #2138
This commit is contained in:
Brad Rydzewski 2017-07-25 14:01:28 -04:00 committed by GitHub
commit aadcde2b2c

View file

@ -159,11 +159,15 @@ func PostHook(c *gin.Context) {
}
err = Config.Storage.Config.ConfigCreate(conf)
if err != nil {
logrus.Errorf("failure to persist config for %s. %s", repo.FullName, err)
// retry in case we receive two hooks at the same time
conf, err = Config.Storage.Config.ConfigFind(repo, sha)
if err != nil {
logrus.Errorf("failure to find or persist build config for %s. %s", repo.FullName, err)
c.AbortWithError(500, err)
return
}
}
}
build.ConfigID = conf.ID
netrc, err := remote_.Netrc(user, repo)