-
Notifications
You must be signed in to change notification settings - Fork 23
Open
Description
I have a clustered Redis setup and besides using it as a data store, I also use it as a distributed socket.io adapter. Is it safe to reuse the same Redis client for warlock or should I create a separate one?
Below is my current Redis config:
const Redis = require('ioredis')
const redisAdapter = require('socket.io-redis')
const Warlock = require('node-redis-warlock')
const startupNodes = [{
port: process.env.REDIS_PORT,
host: process.env.REDIS_HOST
}]
const redis = new Redis.Cluster(startupNodes)
// pubClient can be the same client, but the subClient needs to be a new instance
const ioAdapter = redisAdapter({
pubClient: redis,
subClient: new Redis.Cluster(startupNodes)
})
// is this line safe?
const warlock = new Warlock(redis)
or should the last line be:
const warlock = new Warlock(new Redis.Cluster(startupNodes))
Thank you so much in advance! :)
Metadata
Metadata
Assignees
Labels
No labels