node-redis
node-redis copied to clipboard
feat: added commandTimeout option
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 testpass 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)?