Fix duplicate migrated milestones (#30102) (#30105)

backport #30102
pull/30108/head
yp05327 8 months ago committed by GitHub
parent 6d47b63be2
commit a0f89ba8c7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 3
      services/migrations/migrate.go

@ -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:]

Loading…
Cancel
Save