mirror of
https://github.com/go-gitea/gitea.git
synced 2025-07-23 13:55:53 +02: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) {
|
func SearchBadges(ctx context.Context, opts *SearchBadgeOptions) (badges []*Badge, _ int64, _ error) {
|
||||||
sessCount := opts.toSearchQueryBase(ctx)
|
sessCount := opts.toSearchQueryBase(ctx)
|
||||||
defer sessCount.Close()
|
|
||||||
count, err := sessCount.Count(new(Badge))
|
count, err := sessCount.Count(new(Badge))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, 0, fmt.Errorf("count: %w", err)
|
return nil, 0, fmt.Errorf("count: %w", err)
|
||||||
}
|
}
|
||||||
|
sessCount.Close()
|
||||||
|
|
||||||
if len(opts.OrderBy) == 0 {
|
if len(opts.OrderBy) == 0 {
|
||||||
opts.OrderBy = db.SearchOrderByID
|
opts.OrderBy = db.SearchOrderByID
|
||||||
|
Loading…
x
Reference in New Issue
Block a user