Migrations: Gitea should not fail just because of no apiConfig return (#13229) (#13273)

* close #13227

* log it

👍

Co-authored-by: zeripath <art27@cantab.net>

Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>

Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
This commit is contained in:
6543 2020-10-23 13:11:40 +02:00 committed by GitHub
parent ad4dde1d49
commit 39412c61bf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -101,12 +101,13 @@ func NewGiteaDownloader(ctx context.Context, baseURL, repoPath, username, passwo
// set small maxPerPage since we can only guess // set small maxPerPage since we can only guess
// (default would be 50 but this can differ) // (default would be 50 but this can differ)
maxPerPage := 10 maxPerPage := 10
// new gitea instances can tell us what maximum they have // gitea instances >=1.13 can tell us what maximum they have
if giteaClient.CheckServerVersionConstraint(">=1.13.0") == nil { apiConf, _, err := giteaClient.GetGlobalAPISettings()
apiConf, _, err := giteaClient.GetGlobalAPISettings() if err != nil {
if err != nil { log.Info("Unable to get global API settings. Ignoring these.")
return nil, err log.Debug("giteaClient.GetGlobalAPISettings. Error: %v", err)
} }
if apiConf != nil {
maxPerPage = apiConf.MaxResponseItems maxPerPage = apiConf.MaxResponseItems
} }