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

Method getChatDebugRetentionDays

coderd/exp_chats.go:5543–5556  ·  view source on GitHub ↗

getChatDebugRetentionDays returns the deployment-wide chat debug run retention window. Any authenticated user can read it; writes require admin. nolint:revive // get-return: revive assumes get* must be a getter, but this is an HTTP handler.

(rw http.ResponseWriter, r *http.Request)

Source from the content-addressed store, hash-verified

5541//
5542//nolint:revive // get-return: revive assumes get* must be a getter, but this is an HTTP handler.
5543func (api *API) getChatDebugRetentionDays(rw http.ResponseWriter, r *http.Request) {
5544 ctx := r.Context()
5545 retentionDays, err := api.Database.GetChatDebugRetentionDays(ctx, codersdk.DefaultChatDebugRetentionDays)
5546 if err != nil {
5547 httpapi.Write(ctx, rw, http.StatusInternalServerError, codersdk.Response{
5548 Message: "Failed to get chat debug retention days.",
5549 Detail: err.Error(),
5550 })
5551 return
5552 }
5553 httpapi.Write(ctx, rw, http.StatusOK, codersdk.ChatDebugRetentionDaysResponse{
5554 DebugRetentionDays: retentionDays,
5555 })
5556}
5557
5558// Keep in sync with the validation schema in
5559// site/src/pages/AgentsPage/components/DebugRetentionSettings.tsx.

Callers 1

chatDebugRetentionDaysFunction · 0.80

Calls 4

WriteFunction · 0.92
ContextMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected