by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • May 27 19:28
    alexandre-abrioux opened #1139
  • May 27 19:17
    alexandre-abrioux opened #1138
  • May 27 16:48
    alexandre-abrioux closed #1115
  • May 27 16:48
    alexandre-abrioux commented #1115
  • May 27 16:48
    alexandre-abrioux opened #1137
  • May 26 23:29
    jbeaudoin11 closed #1136
  • May 26 22:12
    jbeaudoin11 commented #1136
  • May 26 21:28
    alavers commented #1136
  • May 26 16:49
    gielow commented #1133
  • May 26 03:06
    jbeaudoin11 edited #1136
  • May 26 02:36
    jbeaudoin11 opened #1136
  • May 25 20:58
    biolypl opened #1135
  • May 24 20:02
    Adizbek commented #1121
  • May 20 18:16
    shamim-42 commented #763
  • May 20 18:16
    shamim-42 commented #763
  • May 20 14:01
    luin commented #1134
  • May 20 13:59
    billinghamj commented #1134
  • May 20 12:54
    demian85 commented #1042
  • May 20 10:13
    aalimovs commented #1042
  • May 19 23:06
    williamgrosset commented #1069
Jiang Wenjian
@jwenjian
@shatyajeet me too.
same issue
@shatyajeet same issue here
any solution
Jiang Wenjian
@jwenjian
another issue from here: I subscribe a channel via cluster node, found out duplicate message received even when only one message were produced
Yogesh Yadav
@yogeshyadav108098
can we specify timeout for get commane?
command*
i am new here
Nico Kokonas
@nicoandmee
can anyone help me? i am trying to just use my redis cache w/ io redis ina google cloud function. its working- but throwing constant ETTIMEOUT errors (almost 10k now)
Thomas Havlik
@thavlik
@nicoandmee are you using TLS? What's your setup like?
Thomas Havlik
@thavlik
Sooo I am running a 3 master + 3 slave cluster and I am not able to do KEYS * across the whole cluster from node
How can I instruct my client to correct to the correct node in order to do this?
Thomas Havlik
@thavlik
Found it in the docs :) nm
Eric Eastwood
@MadLittleMods
@thavlik Link it so future onlookers can benefit
Thomas Havlik
@thavlik
"Running commands to multiple nodes" found on https://www.npmjs.com/package/ioredis
For those curious, this seems to work for me right now:
Thomas Havlik
@thavlik
const pattern = `{${from}}:*`;
        const slot = await redis.cluster("keyslot", pattern);
        let [host, port] = (redis as any).slots[slot][0].split(":");
        port = Number.parseInt(port);
        const master = redis.nodes("master").find((node: any) => node.stream.remoteAddress === host && node.stream.remotePort === port);
        const keys = await master.keys(pattern); // works
Thomas Havlik
@thavlik
If I'm running a cluster and want pub/sub, does the subscriber need to be connected to the entire cluster as well or just one node?
Ah, node specification is only for initial discovery :) so it is good to specify the whole cluster; the number of concurrent connections to each client is invariant of cluster size
Jason Shin
@JasonShin
hey guys, after setting a key with an expiry date using ioredis, how do you create an event to listen for the key expiry?
Christian Roy
@roychri
You have to enable the events and then use pubsub to be notified. Details on that link
Jason Shin
@JasonShin
is it like
  • enable the notification
  • redis.subscribe('EXPIRE', () => {})
Christian Roy
@roychri
Something like that, but it's not on EXPIRE that you will subscribe, but something like :__keyevent@0__:expire where 0 is the db. And the value you will get in the messag will be the name of the key that expire.
Jason Shin
@JasonShin
ok cool
thanks
do you know how to enable Redis Keyspace Notifications using https://hub.docker.com/_/redis?
Christian Roy
@roychri
Docker!!! :heart_eyes_cat: sure, one sec.
Jason Shin
@JasonShin
=)
thank you so much~~
Christian Roy
@roychri
You mount your own redis.conf file (volume) and you change the CMD to pass that config file.
Go down to "Additionally, If you want to use your own redis.conf" on that link you just gave me for an example.
notify-keyspace-events xK to only enable expired events
I found this
do you just include that line in the file
and mount it?
Christian Roy
@roychri
If you use that image (and not the one you first showed me) then yes.
But that image is not the official image
If you use the official image, just make an empty file with that one line, mount it and change CMD to use your file
OR, you could also enable it by your app
once connected send CONFIG SET notify-keyspace-events xK
and that will enable it
without having to mount any file
Jason Shin
@JasonShin
yeah right
i chose the config mount approach
but having a problem
Christian Roy
@roychri
This is a docker discussion, not an ioredis discussion... mind to continue this in docker/docker room?
Jason Shin
@JasonShin

I've mounted redis.conf to /usr/local/etc/redis/redis.conf

and it contains notify-keyspace-events Ex

Code:

redis.set('test', 12, 'EX', 1);
console.log(await redis.get('test')); // return 12
redis.subscribe('__keyevent@0__:expire', (x, y, c, v, b) => {
    console.log('zz', x, y, c, v, b);
});

The console.log return zz null 1 undefined undefined undefined for the first time then errors

error: Connection in subscriber mode, only subscriber commands may be used
error: Error: Connection in subscriber mode, only subscriber commands may be used
sorry this is more of an ioredis question I believe
Christian Roy
@roychri
oh, yes it is. sorry.