go-generics-cache icon indicating copy to clipboard operation
go-generics-cache copied to clipboard

Refactor DeleteExpired for safer behavior

Open AxelPrel opened this issue 1 year ago • 3 comments

  • 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.

AxelPrel avatar Jun 27 '24 09:06 AxelPrel

it might also fix #59

AxelPrel avatar Jun 27 '24 09:06 AxelPrel

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.

codecov[bot] avatar Jun 28 '24 13:06 codecov[bot]

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

gonejack avatar Jul 17 '24 03:07 gonejack