mirror of
https://github.com/go-gitea/gitea
synced 2024-12-22 09:27:56 +01:00
close session immediately
This commit is contained in:
parent
d55e25ff4d
commit
d9efbf30ca
@ -185,11 +185,11 @@ func (opts *SearchBadgeOptions) ToJoins() []db.JoinFunc {
|
||||
|
||||
func SearchBadges(ctx context.Context, opts *SearchBadgeOptions) (badges []*Badge, _ int64, _ error) {
|
||||
sessCount := opts.toSearchQueryBase(ctx)
|
||||
defer sessCount.Close()
|
||||
count, err := sessCount.Count(new(Badge))
|
||||
if err != nil {
|
||||
return nil, 0, fmt.Errorf("count: %w", err)
|
||||
}
|
||||
sessCount.Close()
|
||||
|
||||
if len(opts.OrderBy) == 0 {
|
||||
opts.OrderBy = db.SearchOrderByID
|
||||
|
Loading…
Reference in New Issue
Block a user