You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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! :)
The text was updated successfully, but these errors were encountered:
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 forwarlock
or should I create a separate one?Below is my current Redis config:
or should the last line be:
const warlock = new Warlock(new Redis.Cluster(startupNodes))
Thank you so much in advance! :)
The text was updated successfully, but these errors were encountered: