chameleonbr / node-red-contrib-redis

Node RED client for Redis with pub/sub, list, lua scripting and other commands support.
MIT License
46 stars 42 forks source link

Some questions regarding redis instances and separate databases #30

Closed svdasein closed 4 years ago

svdasein commented 4 years ago

A few questions for you if you have a moment to answer them:

I am asking these questions because I'm running into an issue where I sometimes cannot seem to communicate to a particular database in redis. I am connected to e.g. database 9 and can talk to it, but for some reason on certain flows I cannot talk to database 8.

Thanks for your time.

edit: I just hacked in a forced "true" for the "block" attribute of the redis command node type. having done that, my problems have gone away. So I suspect something is really going on with scoping & connection sharing (as I understand if if "block" is true each node gets its own connection to redis)

chameleonbr commented 4 years ago

Hi with redis instance you could add ioredis connection to function node, example code:

let redisFromFlow = flow.get("redis"); //now yout could use any method from ioredis client

let redisFromGlobal = global.get("redisGlobal");

I will test if my module have some bug related to this.