redis / ioredis

🚀 A robust, performance-focused, and full-featured Redis client for Node.js.
MIT License
14.06k stars 1.19k forks source link

Data writing to wrong db after some time #1891

Closed zaidiqbal closed 1 month ago

zaidiqbal commented 1 month ago

Hi,

I have 2 dbs, db0, db1. I use only db0. What happens is that data is correctly entered into db0 and after some time the data starts being writing to db1 without any clear reason.

I have manually added db: 0, during connection to remove the probability of mistakenly connecting to db1, but still it writes data to db: 1 after some time.

I am using ioredis version 5.3.1, your help is appreciated, thanks

leibale commented 1 month ago

are you using the SELECT command at any point (i.e calling client.select or client.call('SELECT'))?

zaidiqbal commented 1 month ago

no, I just use methods like sadd, smembers etc

zaidiqbal commented 1 month ago

are you using the SELECT command at any point (i.e calling client.select or client.call('SELECT'))?

It was actually this issue, somewhere in the code the select statement was hidden, thanks, it is working fine now.

leibale commented 1 month ago

:)