onur-ozkan / nestjs-rate-limiter

Highly configurable and extensible rate limiter library
https://npmjs.com/package/nestjs-rate-limiter
MIT License
238 stars 43 forks source link

On redis connection failure, it kills the application #77

Open sanjitbauli opened 3 years ago

sanjitbauli commented 3 years ago

When Redis connection fails, it kills the applications. The expected behavior is, log some error or handle the exception somehow.

Here my requirement is, allow users actions when Redis connection fails. An option would be great if we can control this situation. I am passing the client by creating like

redis.createClient({
    ...redisConfig
    })
    .on('error', (e) => {
        console.error('Redis error', e)
    })

but it is not handled by RateLimiterModule

Whereas i use the same client with another package rate-limiter-flexible and I have a way to handle the situation.