MCPcopy Index your code
hub / github.com/coder/coder / loadDismissedHealthchecks

Function loadDismissedHealthchecks

coderd/debug.go:324–338  ·  view source on GitHub ↗

nolint:unused

(ctx context.Context, db database.Store, logger slog.Logger)

Source from the content-addressed store, hash-verified

322func _debugExpVar(http.ResponseWriter, *http.Request) {} //nolint:unused
323
324func loadDismissedHealthchecks(ctx context.Context, db database.Store, logger slog.Logger) []healthsdk.HealthSection {
325 dismissedHealthchecks := []healthsdk.HealthSection{}
326 settingsJSON, err := db.GetHealthSettings(ctx)
327 if err == nil {
328 var settings healthsdk.HealthSettings
329 err = json.Unmarshal([]byte(settingsJSON), &settings)
330 if len(settings.DismissedHealthchecks) > 0 {
331 dismissedHealthchecks = settings.DismissedHealthchecks
332 }
333 }
334 if err != nil && !xerrors.Is(err, sql.ErrNoRows) {
335 logger.Error(ctx, "unable to fetch health settings", slog.Error(err))
336 }
337 return dismissedHealthchecks
338}
339
340// ProfileCollector abstracts the mechanics of collecting pprof/trace
341// data from the Go runtime. Production code uses defaultProfileCollector;

Callers 1

debugDeploymentHealthMethod · 0.85

Calls 4

GetHealthSettingsMethod · 0.65
UnmarshalMethod · 0.45
IsMethod · 0.45
ErrorMethod · 0.45

Tested by

no test coverage detected