dial-once/node-cache-manager-redis

Need a way to drain the underlying redis connection pool

thenikso opened this issue · 2 comments

Hi there!

I'm using this amazing cache/cache store in an AWS lambda function and noticed that it was hanging open without terminating. I managed to fix this by doing something like this:

redisCache.store._pool.drain();

When my app is finished. Is this correct? Am I guaranteed that the cache entries have been written? (I don't wait for them when doing set).

If so I think there should be a better way to do this or at least a word about it in the readme.

Actually this is more complicated then expected. If the pool is drained but you have caches outside the lambda handler (which will live until AWS decides to kill the instance), those caches will not work because pool is draining and cannot accept work.

@thenikso Since we use solRedisPool perhaps you can ask get more info about your requirement at that project.