mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-10-31 22:38:58 +00:00
backport #30102 (cherry picked from commit a0f89ba8c76dd77990f73151cf60e9b945c31587)
This commit is contained in:
parent
29b352f490
commit
706ff7aa9f
1 changed files with 1 additions and 2 deletions
|
@ -250,14 +250,13 @@ func migrateRepository(ctx context.Context, doer *user_model.User, downloader ba
|
||||||
}
|
}
|
||||||
log.Warn("migrating milestones is not supported, ignored")
|
log.Warn("migrating milestones is not supported, ignored")
|
||||||
}
|
}
|
||||||
|
|
||||||
msBatchSize := uploader.MaxBatchInsertSize("milestone")
|
msBatchSize := uploader.MaxBatchInsertSize("milestone")
|
||||||
for len(milestones) > 0 {
|
for len(milestones) > 0 {
|
||||||
if len(milestones) < msBatchSize {
|
if len(milestones) < msBatchSize {
|
||||||
msBatchSize = len(milestones)
|
msBatchSize = len(milestones)
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := uploader.CreateMilestones(milestones...); err != nil {
|
if err := uploader.CreateMilestones(milestones[:msBatchSize]...); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
milestones = milestones[msBatchSize:]
|
milestones = milestones[msBatchSize:]
|
||||||
|
|
Loading…
Reference in a new issue