Performance improvements for pull request list API (#30490)
Fix #30483 --------- Co-authored-by: yp05327 <576951401@qq.com> Co-authored-by: Giteabot <teabot@gitea.io> (cherry picked from commit 352a2cae247afa254241f113c5c22b9351f116b9)
This commit is contained in:
parent
3e5f85ccf3
commit
47a2102694
12 changed files with 243 additions and 130 deletions
|
@ -894,6 +894,10 @@ func GetUserByID(ctx context.Context, id int64) (*User, error) {
|
|||
|
||||
// GetUserByIDs returns the user objects by given IDs if exists.
|
||||
func GetUserByIDs(ctx context.Context, ids []int64) ([]*User, error) {
|
||||
if len(ids) == 0 {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
users := make([]*User, 0, len(ids))
|
||||
err := db.GetEngine(ctx).In("id", ids).
|
||||
Table("user").
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue