Closed PandasProperty closed 1 year ago
I've replaced my redis
with ioredis
...
const redisClient = new Redis({
host: 'redis-something.cloud.redislabs.com',
username: 'XXX',
password: 'XXX',
port: XXX,
})
...
const options = {
host: 'YYYY'
username: 'XXX',
password: 'XXX',
port: YYYY,
retryStrategy: (times: number) => {
return Math.min(times * 50, 2000);
}
}
...
redisClient.on('connect', () => {
console.log('Redis client connected successfully') // this is logged
PublicationSubscription = new RedisPubSub({
connection: options,
publisher: new Redis(options),
subscriber: new Redis(options)
})
})
the same. my redisClient
gets connected to the right instance and the RedisPubSub
searches for localhost
Please help :(
had a lost new RedisPubSub()
in another part of the code,I wrote it there when setting up to see the subscriptions all work and forgot about it.
When running manually with npm start it connects ok to the remote redis. But inside docker it searches for localhost:
I have the following code: