node-redis icon indicating copy to clipboard operation
node-redis copied to clipboard

feat: added commandTimeout option

Open bronikabrisbon opened this issue 6 months ago • 0 comments

Description

Some calls to redis took too long in our app by this feature this calls can be aborted. The PR adds a commandTimeout to the RedisClientOptions. If the commandTimeout is set in the createClient, then a timeout is set in the _executeCommand function. The redisClient is used in the RateLimiterRedis in our app. In the case of a timeout the RateLimiterRedis insurance is supposed to be used as fallback. Therefore a Promise.race does not work.


Checklist

  • [ ] Does npm test pass with this change (including linting)?
  • [ ] Is the new or changed code fully tested?
  • [ ] Is a documentation update included (if this change modifies existing APIs, or introduces new ones)?

bronikabrisbon avatar Apr 23 '25 13:04 bronikabrisbon