You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Don't work methods that use KEYS command(ioredis) #245
Thank you for your examples! That helped me to see that the issue was coming from any command which relies on redis.keys(), as other methods work OK with the keyPrefix.
It seems that supporting a keyPrefix with redis.keys() is explicitly not support by ioredis. It is mentioned in their readme, and in a number of issues:
The first argument of KEYS command is a pattern rather than key name, so we don't prefix it with keyPrefix.
and I agree with him. I think that using keyPrefix in this way is dangerous at the command level. That is why we use redis "namespaces" instead in a way we have direct control over, which allows a similar result.
I would recommend either using databases within your redis server to arrange your data, rather thankeyPrefix going forward.
I will add a note to our readme that we do not support keyPrefix with ioredis (#256)
Activity
[-]Don't work methods who use KEYS command(ioredis)[/-][+]Don't work methods who that KEYS command(ioredis)[/+][-]Don't work methods who that KEYS command(ioredis)[/-][+]Don't work methods that use KEYS command(ioredis)[/+]evantahler commentedon Jun 8, 2018
Can you confirm that your keyPrefix does not have an special charecters?
As a note this might be conflicting with the node-resque "namespace" option:
witem commentedon Jun 8, 2018
Yes, it doesn't have any special charecters. And it not conflicting with
namespaceoption.I use
keyPrefix:undefinedshmellusebaz commentedon Jul 10, 2018
@evantahler ping =)
evantahler commentedon Jul 10, 2018
In d3477e4 I've added a number of passing tests which demonstrate that (I think) the ioredis+prefix behavior is working properly.
Please fork this project, and add a failing test to this section which demonstrates the problem you are observing.
master | add failed test for issue actionhero#245
witem commentedon Jul 11, 2018
Hi @evantahler
I add failed tests for
queue.timestamps: witem@cad30e1But I think also broken next methods:
queue.locks()queue.stats()scheduler.checkStuckWorkers()witem commentedon Jul 18, 2018
Hi @evantahler
It's normal test case?
evantahler commentedon Jul 18, 2018
Thank you for your examples! That helped me to see that the issue was coming from any command which relies on
redis.keys(), as other methods work OK with thekeyPrefix.It seems that supporting a
keyPrefixwithredis.keys()is explicitly not support byioredis. It is mentioned in their readme, and in a number of issues:keyPrefixoption is being used redis/ioredis#381The most clear response from @luin is
and I agree with him. I think that using keyPrefix in this way is dangerous at the command level. That is why we use redis "namespaces" instead in a way we have direct control over, which allows a similar result.
I would recommend either using databases within your redis server to arrange your data, rather than
keyPrefixgoing forward.I will add a note to our readme that we do not support
keyPrefixwith ioredis (#256)witem commentedon Jul 19, 2018
@evantahler maybe I can make PR, for allow make connection options
namespacean array.Example:
And in method
connection.keychange unshift(https://github.com/taskrabbit/node-resque/blob/52c11a7932980ebfdcdfd2519d3b508f423680c6/lib/connection.js#L89) to:It's allow to use
namespacemore flexibly.evantahler commentedon Jul 19, 2018
If you make your change non-breaking, ie: it works with both arrays and strings, that could work. Please be sure to test it!
witem commentedon Jul 25, 2018
Hi @evantahler
I add PR #258