*actually* cache counts

This commit is contained in:
Sam 2023-06-25 15:55:44 +02:00
parent 80cf699a73
commit 969e06e31e
No known key found for this signature in database
GPG Key ID: B4EF20DDE721CAA1
1 changed files with 1 additions and 1 deletions

View File

@ -134,7 +134,7 @@ func (db *DB) initMetrics() (err error) {
func (db *DB) Counts(ctx context.Context) (numUsers, numMembers, usersDay, usersWeek, usersMonth int64) {
db.countMu.Lock()
if numUsers != 0 {
if db.usersTotal != 0 {
defer db.countMu.Unlock()
return db.usersTotal, db.membersTotal, db.activeUsersDay, db.activeUsersWeek, db.activeUsersMonth
}