mirror of
https://github.com/miniflux/v2.git
synced 2025-09-15 18:57:04 +00:00
Improve health check endpoint to test database connection
This commit is contained in:
parent
c2571f9f47
commit
e3c28a6c96
4 changed files with 29 additions and 14 deletions
|
@ -79,17 +79,6 @@ func (s *Storage) CountFeeds(userID int64) int {
|
|||
return result
|
||||
}
|
||||
|
||||
// DatabaseVersion returns the version of the database which is in use
|
||||
func (s *Storage) DatabaseVersion() string {
|
||||
var dbVersion string
|
||||
err := s.db.QueryRow(`SELECT current_setting('server_version')`).Scan(&dbVersion)
|
||||
if err != nil {
|
||||
return err.Error()
|
||||
}
|
||||
|
||||
return dbVersion
|
||||
}
|
||||
|
||||
// CountUserFeedsWithErrors returns the number of feeds with parsing errors that belong to the given user.
|
||||
func (s *Storage) CountUserFeedsWithErrors(userID int64) int {
|
||||
pollingParsingErrorLimit := config.Opts.PollingParsingErrorLimit()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue