Skip to content

Commit 39412c6

Browse files
6543zeripathtechknowlogick
authored
Migrations: Gitea should not fail just because of no apiConfig return (#13229) (#13273)
* close #13227 * log it :+1: Co-authored-by: zeripath <[email protected]> Co-authored-by: zeripath <[email protected]> Co-authored-by: techknowlogick <[email protected]> Co-authored-by: zeripath <[email protected]> Co-authored-by: techknowlogick <[email protected]>
1 parent ad4dde1 commit 39412c6

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

modules/migrations/gitea_downloader.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -101,12 +101,13 @@ func NewGiteaDownloader(ctx context.Context, baseURL, repoPath, username, passwo
101101
// set small maxPerPage since we can only guess
102102
// (default would be 50 but this can differ)
103103
maxPerPage := 10
104-
// new gitea instances can tell us what maximum they have
105-
if giteaClient.CheckServerVersionConstraint(">=1.13.0") == nil {
106-
apiConf, _, err := giteaClient.GetGlobalAPISettings()
107-
if err != nil {
108-
return nil, err
109-
}
104+
// gitea instances >=1.13 can tell us what maximum they have
105+
apiConf, _, err := giteaClient.GetGlobalAPISettings()
106+
if err != nil {
107+
log.Info("Unable to get global API settings. Ignoring these.")
108+
log.Debug("giteaClient.GetGlobalAPISettings. Error: %v", err)
109+
}
110+
if apiConf != nil {
110111
maxPerPage = apiConf.MaxResponseItems
111112
}
112113

0 commit comments

Comments
 (0)