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

Method GetStaleChats

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

Find chats that appear stuck and need recovery: 1. Running chats whose heartbeat has expired (worker crash). 2. requires_action chats past the timeout threshold (client disappeared). 3. Waiting chats with a non-empty queue and stale updated_at (deferred-promote stranding when the worker dies before

(ctx context.Context, staleThreshold time.Time)

Source from the content-addressed store, hash-verified

663 // (deferred-promote stranding when the worker dies before its
664 // post-cancel cleanup runs).
665 GetStaleChats(ctx context.Context, staleThreshold time.Time) ([]Chat, error)
666 GetTailnetPeers(ctx context.Context, id uuid.UUID) ([]TailnetPeer, error)
667 GetTailnetTunnelPeerBindingsBatch(ctx context.Context, ids []uuid.UUID) ([]GetTailnetTunnelPeerBindingsBatchRow, error)
668 GetTailnetTunnelPeerIDsBatch(ctx context.Context, ids []uuid.UUID) ([]GetTailnetTunnelPeerIDsBatchRow, error)

Callers 4

GetStaleChatsMethod · 0.65
GetStaleChatsMethod · 0.65
TestChatsMethod · 0.65
recoverStaleChatsMethod · 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

TestChatsMethod · 0.52