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

Method AcquireProvisionerJob

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

Acquires the lock for a single job that isn't started, completed, canceled, and that matches an array of provisioner types. SKIP LOCKED is used to jump over locked rows. This prevents multiple provisioners from acquiring the same jobs. See: https://www.postgresql.org/docs/9.5/sql-select.html#SQL-FO

(ctx context.Context, arg AcquireProvisionerJobParams)

Source from the content-addressed store, hash-verified

41 // multiple provisioners from acquiring the same jobs. See:
42 // https://www.postgresql.org/docs/9.5/sql-select.html#SQL-FOR-UPDATE-SHARE
43 AcquireProvisionerJob(ctx context.Context, arg AcquireProvisionerJobParams) (ProvisionerJob, error)
44 AcquireStaleChatDiffStatuses(ctx context.Context, limitVal int32) ([]AcquireStaleChatDiffStatusesRow, error)
45 // Bumps the workspace deadline by the template's configured "activity_bump"
46 // duration (default 1h). If the workspace bump will cross an autostart

Callers 8

TestQueuePositionFunction · 0.65
doInTXMethod · 0.65
AcquireProvisionerJobMethod · 0.65
AcquireProvisionerJobMethod · 0.65
TestSystemFunctionsMethod · 0.65
ProvisionerJobFunction · 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 4

TestQueuePositionFunction · 0.52
TestSystemFunctionsMethod · 0.52