mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-08-02 16:35:19 +02:00
improve github downloader on migrations (#7049)
* improve github downloader on migrations * fix tests * fix uppercase function parameters
This commit is contained in:
parent
43cf2f3b55
commit
7d12ec2abd
5 changed files with 141 additions and 151 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue