-
-
Notifications
You must be signed in to change notification settings - Fork 353
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow unbounded storage if maxSize or ttl set
This also prevents setting size=0 if maxSize is set, since that is a recipe for disaster. At least one of max, maxSize, or ttl MUST be set, to prevent unbounded growth of the cache. And really, without ttlAutopurge, it's effectively unsafe and unbounded in that case anyway, *especially* if allowStale is set. This is potentially "unsafe at any speed" territory, so it emits a process warning in that case. If max is not set, then regular Array is used to track items, without setting an initial Array capacity. This will often perform much worse, but in many cases, it's not so bad. Bigger hazard is definitely unbounded memory consumption. Fix: #208
- Loading branch information
Showing
9 changed files
with
184 additions
and
42 deletions.
There are no files selected for viewing
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
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
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
Oops, something went wrong.