mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-12-20 20:07:03 +01:00
Fix duplicate migrated milestones (#30102)
Fix #17567 (cherry picked from commit 274bc00ca2c3bf5a734d74e47cc28fa8c41e3875)
This commit is contained in:
parent
f77922ce4e
commit
e93e29822d
1 changed files with 1 additions and 2 deletions
|
@ -257,14 +257,13 @@ func migrateRepository(ctx context.Context, doer *user_model.User, downloader ba
|
|||
}
|
||||
log.Warn("migrating milestones is not supported, ignored")
|
||||
}
|
||||
|
||||
msBatchSize := uploader.MaxBatchInsertSize("milestone")
|
||||
for len(milestones) > 0 {
|
||||
if len(milestones) < msBatchSize {
|
||||
msBatchSize = len(milestones)
|
||||
}
|
||||
|
||||
if err := uploader.CreateMilestones(milestones...); err != nil {
|
||||
if err := uploader.CreateMilestones(milestones[:msBatchSize]...); err != nil {
|
||||
return err
|
||||
}
|
||||
milestones = milestones[msBatchSize:]
|
||||
|
|
Loading…
Reference in a new issue