mirror of
https://github.com/miniflux/v2.git
synced 2025-07-22 17:18:37 +00:00
Add Prometheus exporter
This commit is contained in:
parent
16b7b3bc3e
commit
c394a61a4e
61 changed files with 809 additions and 96 deletions
|
@ -16,6 +16,17 @@ import (
|
|||
"golang.org/x/crypto/bcrypt"
|
||||
)
|
||||
|
||||
// CountUsers returns the total number of users.
|
||||
func (s *Storage) CountUsers() int {
|
||||
var result int
|
||||
err := s.db.QueryRow(`SELECT count(*) FROM users`).Scan(&result)
|
||||
if err != nil {
|
||||
return 0
|
||||
}
|
||||
|
||||
return result
|
||||
}
|
||||
|
||||
// SetLastLogin updates the last login date of a user.
|
||||
func (s *Storage) SetLastLogin(userID int64) error {
|
||||
query := `UPDATE users SET last_login_at=now() WHERE id=$1`
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue