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

Method DeleteOldChatFiles

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

TODO(cian): Add indexes on chats(archived, updated_at) and chat_files(created_at) for purge query performance. See: https://github.com/coder/internal/issues/1438 Deletes chat files that are older than the given threshold and are not referenced by any chat that is still active or was archived within

(ctx context.Context, arg DeleteOldChatFilesParams)

Source from the content-addressed store, hash-verified

181 // 2. Files whose every referencing chat has been archived for longer
182 // than the retention period.
183 DeleteOldChatFiles(ctx context.Context, arg DeleteOldChatFilesParams) (int64, error)
184 // Deletes chats that have been archived for longer than the given
185 // threshold. Active (non-archived) chats are never deleted.
186 // Related chat_messages, chat_diff_statuses, and

Callers 6

DeleteOldChatFilesMethod · 0.65
purgeChatsInTxMethod · 0.65
TestMetricsFunction · 0.65
TestDeleteOldChatFilesFunction · 0.65
DeleteOldChatFilesMethod · 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 3

TestMetricsFunction · 0.52
TestDeleteOldChatFilesFunction · 0.52
TestChatsMethod · 0.52