go-generics-cache
go-generics-cache copied to clipboard
Refactor DeleteExpired for safer behavior
-
make sure that expManager queue is not empty before popping, which can happen if an explicit delete happens while DeleteExpired releases the lock.
-
evict() now returns shouldContinue instead of a shouldBreak to simplify the loop.
it might also fix #59
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 100.00%. Comparing base (
2601bb0) to head (a613de3).
:exclamation: Current head a613de3 differs from pull request most recent head f59f96f
Please upload reports for the commit f59f96f to get more accurate results.
Additional details and impacted files
@@ Coverage Diff @@
## main #60 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 11 11
Lines 527 523 -4
=========================================
- Hits 527 523 -4
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
I don't think this would fix #59 as there are no limitation or scale down operations on capacity of expirationManager.queue or expirationManager.map