Merge db.Iterate and IterateObjects (#21641)
These two functions are similiar, merge them.
This commit is contained in:
parent
4ae3f76217
commit
9a70a12a34
12 changed files with 77 additions and 51 deletions
|
@ -5,6 +5,7 @@
|
|||
package private
|
||||
|
||||
import (
|
||||
stdCtx "context"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"strconv"
|
||||
|
@ -60,7 +61,7 @@ func SendEmail(ctx *context.PrivateContext) {
|
|||
}
|
||||
}
|
||||
} else {
|
||||
err := db.IterateObjects(ctx, func(user *user_model.User) error {
|
||||
err := db.Iterate(ctx, nil, func(ctx stdCtx.Context, user *user_model.User) error {
|
||||
if len(user.Email) > 0 && user.IsActive {
|
||||
emails = append(emails, user.Email)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue