-
Notifications
You must be signed in to change notification settings - Fork 5
Refactor domain scheduling and management #152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Remove incremental PPR, adjust cron schedules, add last accessed tracking, and implement dead letter queue for failed tasks. Enhance database schema with new fields for change frequency and last accessed timestamp.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
WalkthroughAdds domain access tracking with last-accessed timestamps, introduces a priority-based scheduling system for section revalidation with dead-letter queue (DLQ) support, implements adaptive TTL calculations, and adds a cron job for database cleanup. Includes database migrations, new queue management capabilities, and enhanced scheduling logic. Changes
Sequence Diagram(s)sequenceDiagram
participant User as User Request
participant Page as app/[domain]/page
participant Repo as Domains Repo
participant Schedule as Schedule System
participant DLQ as Dead-Letter Queue
participant Cron as Queue-Cleanup Cron
User->>Page: Load domain page
Page->>Repo: updateLastAccessed(domain)
Repo->>Repo: Update lastAccessedAt
Note over Schedule: Scheduled Revalidation
Schedule->>Schedule: Acquire lock + Revalidate
alt Success
Schedule->>Repo: incrementChangeFrequency()
Repo->>Repo: Update changeFrequency++
Schedule->>Schedule: Reset backoff, write result
else Failure
Schedule->>Schedule: recordFailureAndBackoff()
Schedule->>Schedule: Increment failure attempts
alt Max attempts reached
Schedule->>DLQ: moveToDLQ(section, domain)
DLQ->>DLQ: Store in DLQ queue<br/>with cooldown
end
end
Schedule->>Schedule: Release lock (all paths)
Note over Cron: Periodic Cleanup
Cron->>Schedule: cleanupOrphanedQueueEntries()
Schedule->>Schedule: Cross-check Redis<br/>vs Database
Schedule->>Schedule: Remove orphaned entries
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: ASSERTIVE Plan: Pro 📒 Files selected for processing (16)
💤 Files with no reviewable changes (1)
🧰 Additional context used🧬 Code graph analysis (7)app/[domain]/page.tsx (1)
app/api/cron/queue-cleanup/route.ts (1)
server/services/registration.ts (1)
lib/schedule.test.ts (5)
lib/inngest/functions/section-revalidate.ts (4)
lib/schedule.ts (5)
lib/db/repos/domains.ts (2)
🔇 Additional comments (11)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #152 +/- ##
==========================================
- Coverage 69.63% 68.92% -0.72%
==========================================
Files 101 102 +1
Lines 2747 2909 +162
Branches 852 885 +33
==========================================
+ Hits 1913 2005 +92
- Misses 514 574 +60
- Partials 320 330 +10 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
Remove incremental PPR, adjust cron schedules, add last accessed tracking, and implement dead letter queue for failed tasks. Enhance database schema with new fields for change frequency and last accessed timestamp.
Summary by CodeRabbit
New Features
Bug Fixes
Tests
Chores