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

Method TouchChatDebugStepAndRun

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

Atomically bumps updated_at on both the step and its parent run in a single statement. This prevents FinalizeStale from interleaving between the two touches and finalizing a run whose step heartbeat was just written. The step UPDATE joins through touched_run (via FROM) and reads its RETURNING rows.

(ctx context.Context, arg TouchChatDebugStepAndRunParams)

Source from the content-addressed store, hash-verified

1159 // mismatched (run_id, step_id) pair cannot silently refresh an
1160 // unrelated step.
1161 TouchChatDebugStepAndRun(ctx context.Context, arg TouchChatDebugStepAndRunParams) error
1162 // Non blocking lock. Returns true if the lock was acquired, false otherwise.
1163 //
1164 // This must be called from within a transaction. The lock will be automatically

Callers 5

TestChatsMethod · 0.65
TouchStepMethod · 0.65
TestLaunchHeartbeatFunction · 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

TestChatsMethod · 0.52
TestLaunchHeartbeatFunction · 0.52