allegro / bigcache

Efficient cache for gigabytes of data written in Go.
http://allegro.tech/2016/03/writing-fast-cache-service-in-go.html
Apache License 2.0
7.45k stars 593 forks source link

check LifeWindow when CleanWindow is set #386

Closed chenyahui closed 9 months ago

chenyahui commented 9 months ago

When set CleanWindow, if LifeWindow isn't set, any data you put in will be wiped out right away. So, we need to add a check to prevent this.

codecov-commenter commented 9 months ago

Codecov Report

Merging #386 (75e0f55) into main (93a748a) will decrease coverage by 0.72%. The diff coverage is 50.00%.

:exclamation: Current head 75e0f55 differs from pull request most recent head b7f5077. Consider uploading reports for the commit b7f5077 to get more accurate results

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/allegro/bigcache/pull/386/graphs/tree.svg?width=650&height=150&src=pr&token=NRx0gXD6he&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None)](https://app.codecov.io/gh/allegro/bigcache/pull/386?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None) ```diff @@ Coverage Diff @@ ## main #386 +/- ## ========================================== - Coverage 89.16% 88.45% -0.72% ========================================== Files 15 15 Lines 794 797 +3 ========================================== - Hits 708 705 -3 - Misses 73 77 +4 - Partials 13 15 +2 ``` | [Files](https://app.codecov.io/gh/allegro/bigcache/pull/386?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None) | Coverage Δ | | |---|---|---| | [bigcache.go](https://app.codecov.io/gh/allegro/bigcache/pull/386?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-YmlnY2FjaGUuZ28=) | `91.60% <50.00%> (-1.37%)` | :arrow_down: | ... and [1 file with indirect coverage changes](https://app.codecov.io/gh/allegro/bigcache/pull/386/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None) ------ [Continue to review full report in Codecov by Sentry](https://app.codecov.io/gh/allegro/bigcache/pull/386?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None). > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None) > `Δ = absolute (impact)`, `ø = not affected`, `? = missing data` > Powered by [Codecov](https://app.codecov.io/gh/allegro/bigcache/pull/386?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None). Last update [93a748a...b7f5077](https://app.codecov.io/gh/allegro/bigcache/pull/386?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None).