forked from mtusi2026/mtusi2026lab4
feat(cleanup): remove stale queued attachments after grace period
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user