Open saltukalakus opened 7 years ago
In my Node.js test environment Number.MAX_SAFE_INTEGER
returns 9007199254740991. Sufficiently bigger than 999999999999.
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
Correct, the library should probably throw if you pass a higher value than setTimeout
can handle. Want to send a PR?
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);