MCPcopy Create free account
hub / github.com/coder/coder / GetPresetsAtFailureLimit

Method GetPresetsAtFailureLimit

coderd/database/querier.go:609–609  ·  view source on GitHub ↗

GetPresetsAtFailureLimit groups workspace builds by preset ID. Each preset is associated with exactly one template version ID. For each preset, the query checks the last hard_limit builds. If all of them failed, the preset is considered to have hit the hard failure limit. The query returns a list of

(ctx context.Context, hardLimit int64)

Source from the content-addressed store, hash-verified

607 // For each preset, check the last hard_limit builds.
608 // If all of them failed, the preset is considered to have hit the hard failure limit.
609 GetPresetsAtFailureLimit(ctx context.Context, hardLimit int64) ([]GetPresetsAtFailureLimitRow, error)
610 // GetPresetsBackoff groups workspace builds by preset ID.
611 // Each preset is associated with exactly one template version ID.
612 // For each group, the query checks up to N of the most recent jobs that occurred within the

Callers 5

TestPrebuildsMethod · 0.65
SnapshotStateMethod · 0.65

Implementers 5

sqlQueriercoderd/database/db.go
queryMetricsStorecoderd/database/dbmetrics/querymetrics
queriercoderd/database/dbauthz/dbauthz.go
MockStorecoderd/database/dbmock/dbmock.go
MockStoreMockRecordercoderd/database/dbmock/dbmock.go

Calls

no outgoing calls

Tested by 2

TestPrebuildsMethod · 0.52