Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
ƇʘƁ̆ąƇ́
@anchnk
For instance, I think I should create the client outside the handler (for AWS Lambda) so that it's getting reuse after a cold start
should I disable the offline queue for instance ? or should I adjust the lambda time out with the retry strategy so that it doesn't interact with it ?
hivemall
@hivemall
i cloned https://github.com/NodeRedis/node_redis and cd into the dir and npm install which created alocal folder
how to require('./path/rel/to/nodered/index.js'); give Error: Cannot find module csloder ?
hivemall
@hivemall
uff, i will create pull request to update installs
Nissim Kurle
@nissim-kurle

Can anyone please tell me how can I perform a transaction in redis while watching the the hash key foo and set a value with key test and value fooTest. The multi is executing with ok but the value is not set in redis.

redisClient.watch("foo", function (err) {
                            if (err) {
                                console.log('There was an error while watching the key foo.');
                            }
                            // Is this the correct usage of multi with hset i could not find it anywhere in documentation?                             
                            // The documentation just says that it will watch the whole hash and trigger if any value of the hash is modified.
                            redisClient.multi().hset(data.conversationID, helper.lastActivity, data.sentTimeStamp).exec(function (err, result) {

                                if (err) {
                                    console.log('There was an error while executing the multi query');
                                }
                                if (result === null) {
                                    console.log('The transaction was not performed since the data was accessed by someone else during the transaction and changed.');
                                }
                            });
                        });

This gives a result [OK] when logged but the value is updated.

hivemall
@hivemall
does this client support streams, i cannot find an exmaple?
like simple XADD key ID field string [field string ...]
is this right https://www.npmjs.com/package/redis-streams or am i off into the blue?
may the worthy lords in here grant me guidance
hivemall
@hivemall
does node js peform encryption of message or is it cleartext, also how about the password?
Paul DeCoursey
@optimuspaul
Been trying to play with the radisgraph module, but I can't get the node_redis client to send the graph.query commands correctly. Any thoughts on how one sends arbitrary commands correctly?
Paul DeCoursey
@optimuspaul
kind of looks like this is just a place where people talk to themselves, is this project still active?
Aditya Mertia
@adityamertia
hello All. I am struggling to find a way to use Keyspace Notifications with node_redis lib. Can someone tell how to listen for changes in a redis key updates ?
Peter Schussheim
@peterschussheim
NodeRedis/node_redis#1254 has anyone found a solution to this issue?
Peter Schussheim
@peterschussheim
how can I ensure that connect-redis does NOT install a dependency to node-redis? i want to ONLY use ioredis as my client
Raghav Garg
@raghavgarg1257
Hello everyone,
I wanted to understand about redis pub/sub. Say if I have a producer which publish messages on multiple channels.
Now, should I create single subscriber and listen to all channel.
or should I create individual subscriber for every channel?
I want to understands what are the best practices..!
Thomas Persson
@thomaspersson
Hi, I have heard that Redis has subscribe functionality, can this be used to subscribe to changes? eg new, updated or deleted data?
Marwan Rabbâa
@waghanza
hi, I have an expected behavior with exists
I store in my local redis sess:85b92d88-0394-4d3e-a0ae-5a5f112aca50, but I can not find it with client.exists('85b92d88-0394-4d3e-a0ae-5a5f112aca50')
(I'm using sess in redisClient options as prefix)
Miguel Rodriquez Cabrera
@syntacticsolutions
Is it possible to store a gzipped JSON in redis?
Karan Thanvi
@thanvi_karan_twitter

I want to increment a key every n seconds in redis using nodejs.
I thought of implementing it like below :

function func(id1, max){
    for(i=0; i < max; i++){       
        client.incr(id1, (error, value) => {
            if(error){
                console.log("redis incr failed : " + error);
                return error;
            }
            console.log("updated value : " + value);
        });
        sleep.sleep(1);
    }
    client.quit();
return("incr value ended for : " + id);    
}

func(id1, max);

But then in this case the complete redis incr happens in a stretch and the callback (console.log("updated value : " + value")) happens with delay (sleep 1).
Afaik, it is caused due to the nodejs being synchronous and (I think) the node_redis client being async.

Could anyone here please help me with this ? Thank you in advance!

Tiago Correia
@tiagocorreiaalmeida
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
@kdthanvi
@tiagocorreiaalmeida thanks. I read about the callbacks and event loop and get this working as of now.
Thanks!
Vlad Potra
@Japjappedulap
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?
Atul
@atul.thorat_gitlab
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
@privateOmega
Can somebody please take a look at this NodeRedis/node_redis#1407
Pagnito
@Pagnito
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
Pagnito
@Pagnito
sry for my bubsauce question, it seems i had localhost socket url on production so i got confused with redis
(`・ω・´)
@mellowmarshe_twitter

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

anantsinha
@anantsinha
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
@mahbodkh

Hi
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]
lg625740749
@lg625740749
@lg625740749
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 10.1.210.69 6379 is ok? i mean in shell when i connected the follower node
Roye Avidor
@RoyeA
Hi all, is there an option to run georadius_ro ( or any other *_ro command )?
Tamlyn Rhodes
@tamlyn

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
@cakoose

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
@cakoose

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
@Ginden
  • 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
@x2bool

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
@makeitcount
Can anyone help me with this issue please tj/connect-redis#287
karthik divi
@karthikdivi_twitter
How to use BLPOP or BRPOP on multiple queues, I see the current API is allowing only one queue.
Ario K
@itsario_twitter
I've used LPUSH and BRPOP
for enqueue and dequeue