feat(coderd/database/dbpurge): add retention for connection logs (#21022)

Add `DeleteOldConnectionLogs` query and integrate it into the `dbpurge`
routine. Retention is controlled by `--retention-connection-logs` flag.
Disabled (0) by default.

Depends on #21021
Updates #20743
This commit is contained in:
Mathias Fredriksson
2025-12-02 16:17:52 +02:00
committed by GitHub
parent 56e7858570
commit 9ebcca5b0d
9 changed files with 213 additions and 2 deletions
+1
View File
@@ -106,6 +106,7 @@ type sqlcQuerier interface {
// Cumulative count.
DeleteOldAIBridgeRecords(ctx context.Context, beforeTime time.Time) (int32, error)
DeleteOldAuditLogConnectionEvents(ctx context.Context, arg DeleteOldAuditLogConnectionEventsParams) error
DeleteOldConnectionLogs(ctx context.Context, arg DeleteOldConnectionLogsParams) (int64, error)
// Delete all notification messages which have not been updated for over a week.
DeleteOldNotificationMessages(ctx context.Context) error
// Delete provisioner daemons that have been created at least a week ago