feat(cleanup): remove stale queued attachments after grace period

This commit is contained in:
kk10
2026-11-03 15:12:55 +03:00
parent fbd9c56b1f
commit 1ee4f8ecec
7 changed files with 189 additions and 36 deletions
+10
View File
@@ -88,6 +88,16 @@ func Run() error {
cleanupWG.Go(func() {
runIdempotencyCleanup(cleanupCtx, log, queries, cfg.Server.IdempotencyTTL, idempotencyCleanupInterval)
})
cleanupWG.Go(func() {
runAttachmentCleanup(
cleanupCtx,
log,
queries,
s3Client,
attachmentOrphanGracePeriod,
attachmentCleanupInterval,
)
})
defer func() {
stopCleanup()
cleanupWG.Wait()