mirror of
https://github.com/coder/coder.git
synced 2025-07-03 16:13:58 +00:00
refactor(coderd): move healthcheck report structs to codersdk (#12279)
Moves healthcheck report-related structs from coderd/healthcheck to codersdk This prevents an import cycle when adding a codersdk.Client method to hit /api/v2/debug/health.
This commit is contained in:
@ -143,7 +143,7 @@ type Options struct {
|
||||
// workspace applications. It consists of both a signing and encryption key.
|
||||
AppSecurityKey workspaceapps.SecurityKey
|
||||
|
||||
HealthcheckFunc func(ctx context.Context, apiKey string) *healthcheck.Report
|
||||
HealthcheckFunc func(ctx context.Context, apiKey string) *codersdk.HealthcheckReport
|
||||
HealthcheckTimeout time.Duration
|
||||
HealthcheckRefresh time.Duration
|
||||
WorkspaceProxiesFetchUpdater *atomic.Pointer[healthcheck.WorkspaceProxiesFetchUpdater]
|
||||
@ -397,7 +397,7 @@ func New(options *Options) *API {
|
||||
UserQuietHoursScheduleStore: options.UserQuietHoursScheduleStore,
|
||||
AccessControlStore: options.AccessControlStore,
|
||||
Experiments: experiments,
|
||||
healthCheckGroup: &singleflight.Group[string, *healthcheck.Report]{},
|
||||
healthCheckGroup: &singleflight.Group[string, *codersdk.HealthcheckReport]{},
|
||||
Acquirer: provisionerdserver.NewAcquirer(
|
||||
ctx,
|
||||
options.Logger.Named("acquirer"),
|
||||
@ -433,7 +433,7 @@ func New(options *Options) *API {
|
||||
}
|
||||
|
||||
if options.HealthcheckFunc == nil {
|
||||
options.HealthcheckFunc = func(ctx context.Context, apiKey string) *healthcheck.Report {
|
||||
options.HealthcheckFunc = func(ctx context.Context, apiKey string) *codersdk.HealthcheckReport {
|
||||
// NOTE: dismissed healthchecks are marked in formatHealthcheck.
|
||||
// Not here, as this result gets cached.
|
||||
return healthcheck.Run(ctx, &healthcheck.ReportOptions{
|
||||
@ -1170,8 +1170,8 @@ type API struct {
|
||||
// This is used to gate features that are not yet ready for production.
|
||||
Experiments codersdk.Experiments
|
||||
|
||||
healthCheckGroup *singleflight.Group[string, *healthcheck.Report]
|
||||
healthCheckCache atomic.Pointer[healthcheck.Report]
|
||||
healthCheckGroup *singleflight.Group[string, *codersdk.HealthcheckReport]
|
||||
healthCheckCache atomic.Pointer[codersdk.HealthcheckReport]
|
||||
|
||||
statsBatcher *batchstats.Batcher
|
||||
|
||||
|
Reference in New Issue
Block a user