diff options
author | yp05327 <576951401@qq.com> | 2024-03-26 19:20:26 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-26 10:20:26 +0000 |
commit | 274bc00ca2c3bf5a734d74e47cc28fa8c41e3875 (patch) | |
tree | 87aeaed5d04a1d7ac73d3d0e1db3472649f09f0c /services/migrations/migrate.go | |
parent | c1ac72150885b327f56ea61273e27b16d6da5435 (diff) | |
download | gitea-274bc00ca2c3bf5a734d74e47cc28fa8c41e3875.tar.gz gitea-274bc00ca2c3bf5a734d74e47cc28fa8c41e3875.zip |
Fix duplicate migrated milestones (#30102)
Fix #17567
Diffstat (limited to 'services/migrations/migrate.go')
-rw-r--r-- | services/migrations/migrate.go | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/services/migrations/migrate.go b/services/migrations/migrate.go index 0b83f3b4a3..5bb3056161 100644 --- a/services/migrations/migrate.go +++ b/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:] |