diff options
author | 6543 <6543@obermui.de> | 2020-10-22 07:46:18 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-22 01:46:18 -0400 |
commit | 81d3942bf0017a92a8e3bab558f2194acff438d2 (patch) | |
tree | 2c6d749584e6a71e437e4ce96712f3bf4f749095 /modules | |
parent | b7deea0284acf5da90a3578cdff37f961442fd90 (diff) | |
download | gitea-81d3942bf0017a92a8e3bab558f2194acff438d2.tar.gz gitea-81d3942bf0017a92a8e3bab558f2194acff438d2.zip |
Migrations: Gitea should not fail just because of no apiConfig return (#13229)
* close #13227
* log it
:+1:
Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Diffstat (limited to 'modules')
-rw-r--r-- | modules/migrations/gitea_downloader.go | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/modules/migrations/gitea_downloader.go b/modules/migrations/gitea_downloader.go index 827cbef5c2..8299c040b0 100644 --- a/modules/migrations/gitea_downloader.go +++ b/modules/migrations/gitea_downloader.go @@ -101,12 +101,13 @@ func NewGiteaDownloader(ctx context.Context, baseURL, repoPath, username, passwo // set small maxPerPage since we can only guess // (default would be 50 but this can differ) maxPerPage := 10 - // new gitea instances can tell us what maximum they have - if giteaClient.CheckServerVersionConstraint(">=1.13.0") == nil { - apiConf, _, err := giteaClient.GetGlobalAPISettings() - if err != nil { - return nil, err - } + // gitea instances >=1.13 can tell us what maximum they have + apiConf, _, err := giteaClient.GetGlobalAPISettings() + if err != nil { + log.Info("Unable to get global API settings. Ignoring these.") + log.Debug("giteaClient.GetGlobalAPISettings. Error: %v", err) + } + if apiConf != nil { maxPerPage = apiConf.MaxResponseItems } |