mirror of
https://github.com/gogs/gogs.git
synced 2026-05-06 12:27:31 +02:00
db: use context and go-mockgen for login sources (#7041)
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
package db
|
||||
|
||||
import (
|
||||
"context"
|
||||
"database/sql"
|
||||
"fmt"
|
||||
"os"
|
||||
@@ -208,7 +209,7 @@ type Statistic struct {
|
||||
}
|
||||
}
|
||||
|
||||
func GetStatistic() (stats Statistic) {
|
||||
func GetStatistic(ctx context.Context) (stats Statistic) {
|
||||
stats.Counter.User = CountUsers()
|
||||
stats.Counter.Org = CountOrganizations()
|
||||
stats.Counter.PublicKey, _ = x.Count(new(PublicKey))
|
||||
@@ -223,7 +224,7 @@ func GetStatistic() (stats Statistic) {
|
||||
stats.Counter.Follow, _ = x.Count(new(Follow))
|
||||
stats.Counter.Mirror, _ = x.Count(new(Mirror))
|
||||
stats.Counter.Release, _ = x.Count(new(Release))
|
||||
stats.Counter.LoginSource = LoginSources.Count()
|
||||
stats.Counter.LoginSource = LoginSources.Count(ctx)
|
||||
stats.Counter.Webhook, _ = x.Count(new(Webhook))
|
||||
stats.Counter.Milestone, _ = x.Count(new(Milestone))
|
||||
stats.Counter.Label, _ = x.Count(new(Label))
|
||||
|
||||
Reference in New Issue
Block a user