Phase 8b: 30-day retention cleanup loop#17
Conversation
…fter fix Per user direction: resolve findings, but for non-major/non-catastrophic issues merge after pushing the fix + green CI without waiting for CodeRabbit's formal re-approval (which often lags behind a transient rate limit). Major findings still wait for re-review.
Phase 8b. Hourly background sweep deletes expired uploads (MinIO object + DB row) past expires_at — covers both 30-day-old files and unused pending links. - UploadService: StartRetention/StopRetention + RunRetentionLoop (mirrors the reminder loop), CleanupExpiredAsync (delete object for ready/uploading rows, then delete the row), gated on Config.UploadEnabled. - Bot: start the loop in OnReady. - CLAUDE.md updated.
There was a problem hiding this comment.
Code review is billed via overage credits. To resume reviews, an organization admin can raise the monthly limit at claude.ai/admin-settings/claude-code.
Once credits are available, reopen this pull request to trigger a review.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
📜 Recent review details🧰 Additional context used📓 Path-based instructions (4)**/*.cs📄 CodeRabbit inference engine (CLAUDE.md)
Files:
Bot.cs📄 CodeRabbit inference engine (CLAUDE.md)
Files:
Services/**/*.cs📄 CodeRabbit inference engine (CLAUDE.md)
Files:
{Database.cs,Services/**/*.cs}📄 CodeRabbit inference engine (CLAUDE.md)
Files:
🧠 Learnings (1)📓 Common learnings🪛 LanguageTool.claude/memory/feedback-coderabbit-pr-workflow.md[style] ~11-~11: ‘lags behind’ might be wordy. Consider a shorter alternative. (EN_WORDINESS_PREMIUM_LAGS_BEHIND) 🔇 Additional comments (8)
📝 WalkthroughSummary by CodeRabbit
WalkthroughThis PR adds an hourly retention cleanup path for expired uploads in ChangesUpload retention cleanup
CodeRabbit merge guidance
Sequence Diagram(s)sequenceDiagram
participant Ready as Bot.OnReady
participant Retention as UploadService.StartRetention
participant Sweep as RunRetentionLoop
participant Cleanup as CleanupExpiredAsync
participant Sqlite as uploads table
participant Storage as MinIO
Ready->>Retention: call StartRetention
Retention->>Sweep: start background task
Sweep->>Cleanup: run cleanup pass
Cleanup->>Sqlite: select expired uploads
Sqlite-->>Cleanup: return ids and statuses
Cleanup->>Storage: remove eligible objects
Storage-->>Cleanup: success or error
Cleanup->>Sqlite: delete expired rows
Sqlite-->>Cleanup: return removed count
Sweep->>Sweep: wait one hour
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
Phase 8b — retention cleanup
Hourly background sweep that deletes expired uploads (MinIO object + DB row) once
expires_atpasses — covering both 30-day-old files and unused/stale links.Changes
UploadService—StartRetention/StopRetention+RunRetentionLoop(mirrors the reminder-service loop: try/cancel/error, hourly).CleanupExpiredAsyncselects rows pastexpires_at, removes the MinIO object forready/uploadingrows (best-effort, no id logged), then deletes the row. Gated onConfig.UploadEnabled.Bot— starts the loop inOnReady.CLAUDE.mdupdated.Verification
dotnet build— succeeds, 0 errors.docker-buildCI validates the image.This makes the file relay code-complete. Only 8c remains (agent-cloud: MinIO bucket + Caddy subdomain + redeploy) — which needs the public subdomain + site-config access.