fix(storage): proactively flush expired memory entries#10
Conversation
schedule a `setTimeout` per TTL entry to delete it from the internal Map when it expires, preventing unbounded memory growth from entries that are never read again (e.g. unique URLs with query params). closes nitrojs/nitro#2138
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughEnhanced in-memory storage with proactive TTL-based key expiration. A new Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
📝 Coding Plan
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 |
Schedule a setTimeout per TTL entry to delete it from the internal Map when it expires, preventing unbounded memory growth from entries that are never read again (e.g. unique URLs with varying query params). Closes nitrojs/nitro#2138 Ref unjs/ocache#10
Summary
setTimeoutper TTL entry to proactively delete it from the internalMapwhen it expires.unref()so they don't prevent process exitrelated to nitrojs/nitro#2138
also fixed in unstorage: unjs/unstorage#759
Test plan
Summary by CodeRabbit
Bug Fixes
Tests