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

Method ArchiveUnusedTemplateVersions

coderd/database/dbauthz/dbauthz.go:1644–1653  ·  view source on GitHub ↗
(ctx context.Context, arg database.ArchiveUnusedTemplateVersionsParams)

Source from the content-addressed store, hash-verified

1642}
1643
1644func (q *querier) ArchiveUnusedTemplateVersions(ctx context.Context, arg database.ArchiveUnusedTemplateVersionsParams) ([]uuid.UUID, error) {
1645 tpl, err := q.db.GetTemplateByID(ctx, arg.TemplateID)
1646 if err != nil {
1647 return nil, err
1648 }
1649 if err := q.authorizeContext(ctx, policy.ActionUpdate, tpl); err != nil {
1650 return nil, err
1651 }
1652 return q.db.ArchiveUnusedTemplateVersions(ctx, arg)
1653}
1654
1655func (q *querier) AutoArchiveInactiveChats(ctx context.Context, arg database.AutoArchiveInactiveChatsParams) ([]database.AutoArchiveInactiveChatsRow, error) {
1656 // Background write by dbpurge. The LATERAL read of chat_messages rows

Callers

nothing calls this directly

Calls 3

authorizeContextMethod · 0.95
GetTemplateByIDMethod · 0.65

Tested by

no test coverage detected