Skip to content
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

If the cache timeout is sufficiently big, it doesn't work. #84

Open
saltukalakus opened this issue Mar 10, 2017 · 3 comments · May be fixed by #110
Open

If the cache timeout is sufficiently big, it doesn't work. #84

saltukalakus opened this issue Mar 10, 2017 · 3 comments · May be fixed by #110

Comments

@saltukalakus
Copy link

Set the timeout value to 999999999999, request the key back after 10 seconds and cache doesn't return the value. Observable in latest NPM version => 0.1.6

cache.put(key, value, 999999999999);

@saltukalakus
Copy link
Author

In my Node.js test environment Number.MAX_SAFE_INTEGER returns 9007199254740991. Sufficiently bigger than 999999999999.

@michaelcacciatore
Copy link

Upon further investigation, this is because this library uses setTimeout to control the cache expiration. This means that the maximum value that can be passed in is 2147483647 (maximum positive 32 bit signed integer)

Source: https://nodejs.org/api/timers.html#timers_settimeout_callback_delay_args

@ptarjan
Copy link
Owner

ptarjan commented Jun 19, 2017

Correct, the library should probably throw if you pass a higher value than setTimeout can handle. Want to send a PR?

@reergymerej reergymerej linked a pull request Aug 14, 2019 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants