node-cache-manager-redis-store
node-cache-manager-redis-store copied to clipboard
How to call .quit() or .disconnect() on redisCache.store.getClient()
Hi,
It seems that the original redis functions that allow the client to disconnect from redis are missing, or am I missing something?
var cacheManager = require('cache-manager');
var redisStore = require('cache-manager-redis-store');
var redisCache = cacheManager.caching({
store: redisStore,
host: 'localhost', // default value
port: 6379, // default value
auth_pass: 'XXXXX',
db: 0,
ttl: 600
});
// listen for redis connection error event
var redisClient = redisCache.store.getClient();
In this scenario how do I call redisClient.disconnect()?
I need it in my e2e tests, otherwise the cache manager hangs...
By upgrading to the latest version (v3.0.0) of this package. 😃
Previous versions required you to call redisCache.store.getClient().end(true) to interrupt the connection.