1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2025-09-15 18:56:59 +00:00

Merge db.Iterate and IterateObjects (#21641)

These two functions are similiar, merge them.
This commit is contained in:
Lunny Xiao 2022-10-31 23:51:14 +08:00 committed by GitHub
parent 4ae3f76217
commit 9a70a12a34
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 77 additions and 51 deletions

View file

@ -269,13 +269,10 @@ func fixBrokenRepoUnits16961(ctx context.Context, logger log.Logger, autofix boo
err := db.Iterate(
ctx,
new(RepoUnit),
builder.Gt{
"id": 0,
},
func(idx int, bean interface{}) error {
unit := bean.(*RepoUnit)
func(ctx context.Context, unit *RepoUnit) error {
bs := unit.Config
repoUnit := &repo_model.RepoUnit{
ID: unit.ID,