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

Method GetPresetsBackoff

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

GetPresetsBackoff groups workspace builds by preset ID. Each preset is associated with exactly one template version ID. For each group, the query checks up to N of the most recent jobs that occurred within the lookback period, where N equals the number of desired instances for the corresponding pres

(ctx context.Context, lookback time.Time)

Source from the content-addressed store, hash-verified

622 //
623 // The number of failed builds is used downstream to determine the backoff duration.
624 GetPresetsBackoff(ctx context.Context, lookback time.Time) ([]GetPresetsBackoffRow, error)
625 GetPresetsByTemplateVersionID(ctx context.Context, templateVersionID uuid.UUID) ([]TemplateVersionPreset, error)
626 GetPreviousTemplateVersion(ctx context.Context, arg GetPreviousTemplateVersionParams) (TemplateVersion, error)
627 GetProvisionerDaemons(ctx context.Context) ([]ProvisionerDaemon, error)

Callers 5

TestGetPresetsBackoffFunction · 0.65
GetPresetsBackoffMethod · 0.65
GetPresetsBackoffMethod · 0.65
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

TestGetPresetsBackoffFunction · 0.52
TestPrebuildsMethod · 0.52