feat: add dismissed property to the healthcheck section (#10940)

This commit is contained in:
Marcin Tojek
2023-11-29 16:37:40 +00:00
committed by GitHub
parent d374becdeb
commit 2b574e2b2d
19 changed files with 225 additions and 38 deletions
+8 -3
View File
@@ -18,9 +18,10 @@ const (
// @typescript-generate DatabaseReport
type DatabaseReport struct {
// Healthy is deprecated and left for backward compatibility purposes, use `Severity` instead.
Healthy bool `json:"healthy"`
Severity health.Severity `json:"severity" enums:"ok,warning,error"`
Warnings []string `json:"warnings"`
Healthy bool `json:"healthy"`
Severity health.Severity `json:"severity" enums:"ok,warning,error"`
Warnings []string `json:"warnings"`
Dismissed bool `json:"dismissed"`
Reachable bool `json:"reachable"`
Latency string `json:"latency"`
@@ -32,11 +33,15 @@ type DatabaseReport struct {
type DatabaseReportOptions struct {
DB database.Store
Threshold time.Duration
Dismissed bool
}
func (r *DatabaseReport) Run(ctx context.Context, opts *DatabaseReportOptions) {
r.Warnings = []string{}
r.Severity = health.SeverityOK
r.Dismissed = opts.Dismissed
r.ThresholdMS = opts.Threshold.Milliseconds()
if r.ThresholdMS == 0 {
r.ThresholdMS = DatabaseDefaultThreshold.Milliseconds()