aboutsummaryrefslogtreecommitdiffstats
path: root/modules/migrations/gogs.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2021-06-30 15:23:49 +0800
committerGitHub <noreply@github.com>2021-06-30 15:23:49 +0800
commit09663493543a2ce15fc90fbb3808dda5b87335e5 (patch)
treee9b2ce99e5f0bb3c3115e129feb8194cb9f20f7f /modules/migrations/gogs.go
parente8c6cead0fb926ced6595c7b22f56b1cc2540435 (diff)
downloadgitea-09663493543a2ce15fc90fbb3808dda5b87335e5.tar.gz
gitea-09663493543a2ce15fc90fbb3808dda5b87335e5.zip
Make the github migration less rate limit waiting to get comment per page from repository but not per issue (#16070)
* Make the github migration less rate limit waiting to get comment per page from repository but not per issue * Fix lint * adjust Downloader interface * Fix missed reviews * Fix test * Remove unused struct
Diffstat (limited to 'modules/migrations/gogs.go')
-rw-r--r--modules/migrations/gogs.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/modules/migrations/gogs.go b/modules/migrations/gogs.go
index b616907938..d689b0da11 100644
--- a/modules/migrations/gogs.go
+++ b/modules/migrations/gogs.go
@@ -227,12 +227,13 @@ func (g *GogsDownloader) getIssues(page int, state string) ([]*base.Issue, bool,
}
// GetComments returns comments according issueNumber
-func (g *GogsDownloader) GetComments(issueNumber int64) ([]*base.Comment, error) {
+func (g *GogsDownloader) GetComments(opts base.GetCommentOptions) ([]*base.Comment, bool, error) {
+ var issueNumber = opts.IssueNumber
var allComments = make([]*base.Comment, 0, 100)
comments, err := g.client.ListIssueComments(g.repoOwner, g.repoName, issueNumber)
if err != nil {
- return nil, fmt.Errorf("error while listing repos: %v", err)
+ return nil, false, fmt.Errorf("error while listing repos: %v", err)
}
for _, comment := range comments {
if len(comment.Body) == 0 || comment.Poster == nil {
@@ -249,7 +250,7 @@ func (g *GogsDownloader) GetComments(issueNumber int64) ([]*base.Comment, error)
})
}
- return allComments, nil
+ return allComments, true, nil
}
// GetTopics return repository topics