Skip to content

Commit

Permalink
Fix duplicate migrated milestones (#30102)
Browse files Browse the repository at this point in the history
Fix #17567
  • Loading branch information
yp05327 committed Mar 26, 2024
1 parent c1ac721 commit 274bc00
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions services/migrations/migrate.go
Expand Up @@ -250,14 +250,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:]
Expand Down

0 comments on commit 274bc00

Please sign in to comment.