Add healthcheck to all stores
This commit is contained in:
@@ -126,6 +126,10 @@ func (s *PostgresStore) Stats(statType LoginStats, limit int) ([]StatsResult, er
|
||||
return results, nil
|
||||
}
|
||||
|
||||
func (s *PostgresStore) IsHealthy() bool {
|
||||
return s.db.Ping() == nil
|
||||
}
|
||||
|
||||
func (s *PostgresStore) statsTotal(limit int) ([]StatsResult, error) {
|
||||
uniquePasswordStmt := `select count(*) from (select distinct password from login_attempts) as temp`
|
||||
uniqueUsernameStmt := `select count(*) from (select distinct username from login_attempts) as temp`
|
||||
|
Reference in New Issue
Block a user