diff --git a/server/upstream/domains.go b/server/upstream/domains.go index 6a3e000..5b274b6 100644 --- a/server/upstream/domains.go +++ b/server/upstream/domains.go @@ -29,22 +29,8 @@ func (o *Options) CheckCanonicalDomain(giteaClient *gitea.Client, actualDomain, return domains[0], valid } - var body []byte - var err error - - // 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 - } - + body, err := giteaClient.GiteaRawContent(o.TargetOwner, o.TargetRepo, o.TargetBranch, canonicalDomainConfig) + if err == nil || err == gitea.ErrorNotFound { log.Info().Err(err).Msgf("could not read %s of %s/%s", canonicalDomainConfig, o.TargetOwner, o.TargetRepo) }