node-redlock
node-redlock copied to clipboard
Support for 'redis' client
It looks like support for 'redis' was dropped from v5 in favor of exclusively supporting 'ioredis'. Is that something that might come back in the future?
Also: Is there an upgrading guide?
Here's what happens when trying to use redlock with redis from the 'redis' package (v3, provided by cache-manager-redis-store) instead of 'ioredis':
node_redis: The EVALSHA command contains a invalid argument type.
Only strings, dates and buffers are accepted. Please update your code to use valid argument types.
at RedisClient.internal_send_command (/var/www/html/node_modules/cache-manager-redis-store/node_modules/redis/index.js:835:39)
at RedisClient.evalsha (/var/www/html/node_modules/cache-manager-redis-store/node_modules/redis/lib/commands.js:46:25)
at Redlock._attemptOperationOnClient (/var/www/html/node_modules/redlock/src/index.ts:555:41)
at /var/www/html/node_modules/redlock/src/index.ts:482:16
at new Promise (<anonymous>)
at Redlock._attemptOperation (/var/www/html/node_modules/redlock/src/index.ts:478:18)
at Redlock._execute (/var/www/html/node_modules/redlock/src/index.ts:439:42)
at Redlock.acquire (/var/www/html/node_modules/redlock/src/index.ts:309:39)
at Redlock.using (/var/www/html/node_modules/redlock/src/index.ts:738:27)
at backgroundMutex (webpack-internal:///./src/server/complex-routes/session-cache/CustomerCache.js:323:21)
I asked in https://github.com/mike-marcacci/node-redlock/pull/84#issuecomment-1032374391 as well. Supporting the closest thing to an official node client seems sensible. v4 can probably work in legacyMode: true (connect-redis does)
Also intersted to know if we could get support for redis back.
Interested in this as well. Do we have any explanation / improvement plan with regards to hardwiring to ioredis? Also, if v5 just doesn't work with it, from your experience, can I just use v4 and redis client and it would work reliably?