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

Method AutoArchiveInactiveChats

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

Archives inactive root chats (pinned and already-archived chats skipped), cascading to children via root_chat_id. Limits apply to roots, not total rows. The Go caller passes @archive_cutoff as UTC midnight so that all chats sharing the same last-activity date are archived together. Used by dbpurge.

(ctx context.Context, arg AutoArchiveInactiveChatsParams)

Source from the content-addressed store, hash-verified

71 // created_at ASC flows through to dbpurge's digest truncation; see
72 // buildDigestData in dbpurge.go for the tradeoff rationale.
73 AutoArchiveInactiveChats(ctx context.Context, arg AutoArchiveInactiveChatsParams) ([]AutoArchiveInactiveChatsRow, error)
74 // old_provider is matched as text; new_provider is also cast to ai_provider_type
75 // for the EXISTS check against ai_providers.type.
76 // ai_provider_id IS NOT NULL is defensive; the check constraint already

Callers 4

purgeChatsInTxMethod · 0.65
TestChatsMethod · 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