1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

improve github downloader on migrations (#7049)

* improve github downloader on migrations

* fix tests

* fix  uppercase function parameters
This commit is contained in:
Lunny Xiao
2019-05-31 04:26:57 +08:00
committed by techknowlogick
parent 43cf2f3b55
commit 7d12ec2abd
5 changed files with 141 additions and 151 deletions

View File

@@ -128,8 +128,8 @@ func migrateRepository(downloader base.Downloader, uploader base.Uploader, opts
if opts.Issues {
log.Trace("migrating issues and comments")
for {
issues, err := downloader.GetIssues(0, 100)
for i := 1; ; i++ {
issues, isEnd, err := downloader.GetIssues(i, 100)
if err != nil {
return err
}
@@ -160,7 +160,7 @@ func migrateRepository(downloader base.Downloader, uploader base.Uploader, opts
}
}
if len(issues) < 100 {
if isEnd {
break
}
}
@@ -168,8 +168,8 @@ func migrateRepository(downloader base.Downloader, uploader base.Uploader, opts
if opts.PullRequests {
log.Trace("migrating pull requests and comments")
for {
prs, err := downloader.GetPullRequests(0, 100)
for i := 1; ; i++ {
prs, err := downloader.GetPullRequests(i, 100)
if err != nil {
return err
}