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

Method TryAcquireLock

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

Non blocking lock. Returns true if the lock was acquired, false otherwise. This must be called from within a transaction. The lock will be automatically released when the transaction ends.

(ctx context.Context, pgTryAdvisoryXactLock int64)

Source from the content-addressed store, hash-verified

1164 // This must be called from within a transaction. The lock will be automatically
1165 // released when the transaction ends.
1166 TryAcquireLock(ctx context.Context, pgTryAdvisoryXactLock int64) (bool, error)
1167 // Unarchives a chat (and its children). Stale file references are
1168 // handled automatically by FK cascades on chat_file_links: when
1169 // dbpurge deletes a chat_files row, the corresponding

Callers 8

NewReportGeneratorFunction · 0.65
runOnceMethod · 0.65
startMethod · 0.65
TryAcquireLockMethod · 0.65
purgeTickMethod · 0.65
TestMetricsFunction · 0.65
TryAcquireLockMethod · 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 1

TestMetricsFunction · 0.52