fix: optimize unsubmitted forms cleanup logic and performance#24
fix: optimize unsubmitted forms cleanup logic and performance#24Michellebuchiokonicha wants to merge 2 commits into
Conversation
WalkthroughThe cleanup logic for unsubmitted forms was refactored to replace per-token processing and multiple individual transactions with a bulk, date-filtered fetch and a single consolidated transaction. This optimization reduces database queries and improves efficiency while preserving error handling and job status management. Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
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 |
Task-3
Summary:
Refactored the
cleanup_unsubmitted_formsjob to address correctness, performance, and safety issues identified in the legacy code.Key Changes:
lt7 days) to prevent orphaned data.take: 1000limit to prevent memory exhaustion (OOM) on large backlogs.Walkthrough Video:
https://www.loom.com/share/da0c1f0b3b754003b405eb434cdd8e97
Summary by CodeRabbit