mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-12-27 02:10:40 +00:00
Migrations: Gitea should not fail just because of no apiConfig return (#13229)
* 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>
This commit is contained in:
parent
b7deea0284
commit
81d3942bf0
1 changed files with 7 additions and 6 deletions
|
@ -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 {
|
||||
// gitea instances >=1.13 can tell us what maximum they have
|
||||
apiConf, _, err := giteaClient.GetGlobalAPISettings()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
log.Info("Unable to get global API settings. Ignoring these.")
|
||||
log.Debug("giteaClient.GetGlobalAPISettings. Error: %v", err)
|
||||
}
|
||||
if apiConf != nil {
|
||||
maxPerPage = apiConf.MaxResponseItems
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue