mirror of
https://codeberg.org/Codeberg/pages-server.git
synced 2024-06-16 08:00:54 +02:00
remove inline retry attempts -> #174
This commit is contained in:
parent
d7a403f077
commit
561d54153e
|
@ -29,22 +29,8 @@ func (o *Options) CheckCanonicalDomain(giteaClient *gitea.Client, actualDomain,
|
||||||
return domains[0], valid
|
return domains[0], valid
|
||||||
}
|
}
|
||||||
|
|
||||||
var body []byte
|
body, err := giteaClient.GiteaRawContent(o.TargetOwner, o.TargetRepo, o.TargetBranch, canonicalDomainConfig)
|
||||||
var err error
|
if err == nil || err == gitea.ErrorNotFound {
|
||||||
|
|
||||||
// Make a request to the Gitea instance.
|
|
||||||
// Do at least three attempts before bailing out.
|
|
||||||
for i := 0; i < 3; i++ {
|
|
||||||
body, err = giteaClient.GiteaRawContent(o.TargetOwner, o.TargetRepo, o.TargetBranch, canonicalDomainConfig)
|
|
||||||
if err == nil || err == gitea.ErrorNotFound {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
|
|
||||||
// Only log the error on the last iteration.
|
|
||||||
if i != 2 {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
log.Info().Err(err).Msgf("could not read %s of %s/%s", canonicalDomainConfig, o.TargetOwner, o.TargetRepo)
|
log.Info().Err(err).Msgf("could not read %s of %s/%s", canonicalDomainConfig, o.TargetOwner, o.TargetRepo)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user