The timeout handler for the cache was never unreferenced so it would hold the event loop open even after the program had finished running. We were running into this issue when attempting to the use the cache within lambdas.
Seconding this PR. node-cache currently cannot be used in lambdas without using an undesirable option which forcibly kills the lambda without waiting for the event loop to be empty.
The timeout handler for the cache was never unreferenced so it would hold the event loop open even after the program had finished running. We were running into this issue when attempting to the use the cache within lambdas.
https://nodejs.org/api/timers.html#timers_timeout_unref