dabroek / node-cache-manager-ioredis

Redis store for node-cache-manager using IORedis.
MIT License
59 stars 29 forks source link

support for redisStore(url) #1

Open llwt opened 6 years ago

llwt commented 6 years ago

Taken from this fork: https://github.com/davb/node-cache-manager-ioredis/commit/d27dd8bb7f0e8ac3326d8db062346fe0d0871e17

dabroek commented 6 years ago

Actually, this would be to support redisStore(url). Could you give more context on how this is used?

llwt commented 6 years ago

We use redis config url string rather than config objects in our configs. We are currently doing a bit of extra processing to support the config for this lib.

Right now we do this:

parseRedisUrl is the parse function extracted from ioredis

cacheManager.caching({
  ...parseRedisUrl(config.redisCacheConfig.url),
  store: require('cache-manager-ioredis'),
  ttl: config.redisCacheConfig.ttl,
}),

If this was merged we could do the following and remove the parseRedisUrl fn:

cacheManager.caching({
  url: config.redisCacheConfig.url,
  store: require('cache-manager-ioredis'),
  ttl: config.redisCacheConfig.ttl,
})
llwt commented 6 years ago

@dabroek Have you had a chance to look at this by chance?

soanvig commented 2 years ago

+1 for that functionality

dmtar commented 2 years ago

+1 Can you review that?