Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
Tiago Correia
indeed @thanvi_karan_twitter you have to move the sleep to the inside of the callback on the client.incr
aso client.quit will run probably before any of the above cause its not blocking, and the callback "blocks" the code when it makes the request
try to give a look to callbacks / promises, before moving on I think
Karan Thanvi
@tiagocorreiaalmeida thanks. I read about the callbacks and event loop and get this working as of now.
Vlad Potra
Is it guaranteed that the retry_strategy's option parameter, includes both attempt and times_connected, defined and valid natural numbers?
Meaning, should I handle the corner case when these two parameters are null or undefined?
I am struggling with redis client creation using aws endpoint,
getting getaddrinfo ENOTFOUND error
const client = require("redis").createClient(6379, "AWS_ENDPOINT_STR", { no_ready_check: true });
above code I am using to connect redis server
Kiran Mathew Mohan
Can somebody please take a look at this NodeRedis/node_redis#1407
hey guys
i have a question
Anyone know how to run redis outside of clients machine. I want to run it on the host server
sry for my bubsauce question, it seems i had localhost socket url on production so i got confused with redis

I have a set called "allguilds." I am using this to check if an ID is in there and if so apply a different element. But when I load the page It does probably half or so correct then mixes the set and guild ID.
Not working: 0 for guild undefined, set 373596097869905921.
Working: 1 for guild 539185945442910218, set allguilds.

I use this redis.check('allguilds', guild.id).then(function(res). That is

  check: (set, guild) => client.sismemberAsync(set, guild).then(function(res) {
    console.log(`${res} for guild ${guild}, set ${set}.`)

in the Redis file. I check if res === 1 and if so apply the different element Sorry for the edits forgot the markdown

Do we not have support of Redis streams (added in redis 5) yet ? I tried using XADD but I got an error: redisClient.xadd is not a function
Ebrahim Khosravani

I want convert my result from redisTemplate to my Object that I persisted into redis and got exeption:

        Set<Object> cache = sessionRepository.getSetOps(sessionId);
        userSession = mapper.convertValue(cache, UserSession.class);

And the exception:

 at [Source: UNKNOWN; line: -1, column: -1]] with root cause
com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize instance of `com.rh.cores.architecture.model.rbac.UserSession` out of START_ARRAY token
 at [Source: UNKNOWN; line: -1, column: -1]
Hi All ,i have a question about the configure leader follower (master-slave) replication
https://images2018.cnblogs.com/blog/1075473/201807/1075473-20180730173207029-1055620923.png it not require to set the masterauth?
slaveof 6379 is ok? i mean in shell when i connected the follower node
Roye Avidor
Hi all, is there an option to run georadius_ro ( or any other *_ro command )?
Tamlyn Rhodes

Hi folks. I' a bit confused about the batch command. The docs say:

Identical to .multi without transactions. [...] BATCH commands are queued up until an EXEC is issued, and then all commands are run atomically by Redis.

but this sounds wrong to me. How can a batch be atomic without transactions?

Kannan Goundan

I'm using node_redis. I'm trying to figure out if there's ever a reason to create multiple connections to the same Redis instance.

Specifically, it seems like node_redis' "pipelining" feature means that a single connection (per Redis instance) is almost always the best option. Is that correct?

Kannan Goundan

I wrote up a simple benchmark to see if it's better to use a single shared connection or multiple connections: https://github.com/cakoose/node-redis-pipelining-test

It looks like a single shared connection is the way to go, unless my benchmark is doing something wrong. (Would definitely appreciate feedback!)

Michał Wadas
  • Version: redis@2.8.0
  • Platform: Ubuntu 18, Node 10.
  • Description: Using .scan() command combined with .del() is much slower than using redis-cli.

Bash code:

redis-cli -n 3 --scan --pattern 'cache:*' |  xargs -n500 redis-cli -n 3 del

Node.js code:

  const pattern = 'cache:*';
  const del = promisify(redis.del).bind(redis);
  const scan = promisify(redis.scan).bind(redis);
  do {
    [cursor, keys] = await scan(cursor, 'MATCH', pattern, 'COUNT', '500');
    count += keys.length;
    await Promise.all(keys.map((key) => del(key)));
  } while (cursor !== '0');

For some reason, Node.js code seems to be at least tens times slower. I'm not sure if it's because of my its mistake (I'm not advanced Redis user) or bug in node-redis code.

Sergey Khabibullin

Hey! I made a cross-platform desktop client for Redis: https://rbmk.io

If someone wants to try it and give some feedback that would be great for the project.

Make It Count
Can anyone help me with this issue please tj/connect-redis#287
karthik divi
How to use BLPOP or BRPOP on multiple queues, I see the current API is allowing only one queue.
Ario K
I've used LPUSH and BRPOP
for enqueue and dequeue
Ario K
I'm basically trying to implement a basic retry logic where if the redis server is unreachable for 5 minutes - stop trying to reconnect and throw errors so I can use the errors to perform failover
But the retry_strategy does not reach the total_retry_time within the allocated time
anyone else experience this issue?
Jean-Jacques Dubray
Apologies if this has been asked before but a search didn't yield anything. Would someone be able to share the best way to use node_redis with AWS elasticache failover mode? or cluster mode. I have implemented a crude reconnect (which should be enough in our use case) but if there is something better I'd be happy to take a look.
Guy Korland
Node Redis 3 (3.0.2) is out! with many long pending fixes and enhancments https://github.com/NodeRedis/node-redis/releases/tag/v3.0.0
Ario K
new version?
my node redis reports 'unknown command zpopmin' , can anyone help?
do they just expect us to substitue it by ZREMRANGEBYRANK?
@ShiboXing did you find any answer to this?
I am facing same issue
@CILP did you had any luck with zpopmin/zopmax?
Romil Lodaya
I have deploy API on another server and redis on another server and connect each server for redis but after some time if I try to access redis data from API its giving me AbortError: Redis connection lost and command aborted. It might have been processed
redis error!can anyone help?