-
Notifications
You must be signed in to change notification settings - Fork 163
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(refreshThreshold): don't run if ttl is -1 #604
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Codecov Report
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. @@ Coverage Diff @@
## master #604 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 5 5
Lines 292 292
Branches 75 75
=========================================
Hits 292 292
|
@mihirgupta0900 - thanks for this fix. This should be released with our next update which will be in 2-3 weeks. 🍻 |
renovate bot
referenced
this pull request
in tf2pickup-org/server
Nov 17, 2023
[![Mend Renovate logo banner](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [cache-manager](https://togithub.com/node-cache-manager/node-cache-manager) | [`5.2.4` -> `5.3.1`](https://renovatebot.com/diffs/npm/cache-manager/5.2.4/5.3.1) | [![age](https://developer.mend.io/api/mc/badges/age/npm/cache-manager/5.3.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/cache-manager/5.3.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/cache-manager/5.2.4/5.3.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/cache-manager/5.2.4/5.3.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>node-cache-manager/node-cache-manager (cache-manager)</summary> ### [`v5.3.1`](https://togithub.com/node-cache-manager/node-cache-manager/releases/tag/v5.3.1) [Compare Source](https://togithub.com/node-cache-manager/node-cache-manager/compare/v5.3.0...v5.3.1) Major fix as `5.3.0` did not have the dist folder on release. #### What's Changed - updating to always run vitest with coverage by [@​jaredwray](https://togithub.com/jaredwray) in [https://github.com/node-cache-manager/node-cache-manager/pull/605](https://togithub.com/node-cache-manager/node-cache-manager/pull/605) - fix(refreshThreshold): don't run if ttl is -1 by [@​mihirgupta0900](https://togithub.com/mihirgupta0900) in [https://github.com/node-cache-manager/node-cache-manager/pull/604](https://togithub.com/node-cache-manager/node-cache-manager/pull/604) - fix(caching): coalesce concurrent requests to `wrap` function by [@​douglascayers](https://togithub.com/douglascayers) in [https://github.com/node-cache-manager/node-cache-manager/pull/599](https://togithub.com/node-cache-manager/node-cache-manager/pull/599) - upgrading lru-cache to 10.0.2 by [@​jaredwray](https://togithub.com/jaredwray) in [https://github.com/node-cache-manager/node-cache-manager/pull/609](https://togithub.com/node-cache-manager/node-cache-manager/pull/609) - upgrading eslint, prettier, and types to latest by [@​jaredwray](https://togithub.com/jaredwray) in [https://github.com/node-cache-manager/node-cache-manager/pull/610](https://togithub.com/node-cache-manager/node-cache-manager/pull/610) #### New Contributors - [@​mihirgupta0900](https://togithub.com/mihirgupta0900) made their first contribution in [https://github.com/node-cache-manager/node-cache-manager/pull/604](https://togithub.com/node-cache-manager/node-cache-manager/pull/604) - [@​douglascayers](https://togithub.com/douglascayers) made their first contribution in [https://github.com/node-cache-manager/node-cache-manager/pull/599](https://togithub.com/node-cache-manager/node-cache-manager/pull/599) **Full Changelog**: jaredwray/cacheable@5.2.4...v5.3.1 ### [`v5.3.0`](https://togithub.com/node-cache-manager/node-cache-manager/releases/tag/v5.3.0) [Compare Source](https://togithub.com/node-cache-manager/node-cache-manager/compare/5.2.4...v5.3.0) #### What's Changed - updating to always run vitest with coverage by [@​jaredwray](https://togithub.com/jaredwray) in [https://github.com/node-cache-manager/node-cache-manager/pull/605](https://togithub.com/node-cache-manager/node-cache-manager/pull/605) - fix(refreshThreshold): don't run if ttl is -1 by [@​mihirgupta0900](https://togithub.com/mihirgupta0900) in [https://github.com/node-cache-manager/node-cache-manager/pull/604](https://togithub.com/node-cache-manager/node-cache-manager/pull/604) - fix(caching): coalesce concurrent requests to `wrap` function by [@​douglascayers](https://togithub.com/douglascayers) in [https://github.com/node-cache-manager/node-cache-manager/pull/599](https://togithub.com/node-cache-manager/node-cache-manager/pull/599) - upgrading lru-cache to 10.0.2 by [@​jaredwray](https://togithub.com/jaredwray) in [https://github.com/node-cache-manager/node-cache-manager/pull/609](https://togithub.com/node-cache-manager/node-cache-manager/pull/609) - upgrading eslint, prettier, and types to latest by [@​jaredwray](https://togithub.com/jaredwray) in [https://github.com/node-cache-manager/node-cache-manager/pull/610](https://togithub.com/node-cache-manager/node-cache-manager/pull/610) #### New Contributors - [@​mihirgupta0900](https://togithub.com/mihirgupta0900) made their first contribution in [https://github.com/node-cache-manager/node-cache-manager/pull/604](https://togithub.com/node-cache-manager/node-cache-manager/pull/604) - [@​douglascayers](https://togithub.com/douglascayers) made their first contribution in [https://github.com/node-cache-manager/node-cache-manager/pull/599](https://togithub.com/node-cache-manager/node-cache-manager/pull/599) **Full Changelog**: jaredwray/cacheable@5.2.4...v5.3.0 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/tf2pickup-org/server). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy41OS44IiwidXBkYXRlZEluVmVyIjoiMzcuNTkuOCIsInRhcmdldEJyYW5jaCI6Im1hc3RlciJ9--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Please check if the PR fulfills these requirements
What kind of change does this PR introduce? (Bug fix)
In stores like redis, if no
ttl
value is set,store.ttl(key)
returns-1
. This causes an issue with therefreshThreshold
feature, where the comparison mentioned below will always lead to running the functionhttps://github.com/node-cache-manager/node-cache-manager/blob/2eca5a0c6c905fe706ed9eaca9152dedd512ef7e/src/caching.ts#L92
I've added an additional check to check for
-1
value, and not run the function again.Note: Wasn't sure where to add test for this, please let me know if I need to. I have tested this manually with my work project