express-limiter icon indicating copy to clipboard operation
express-limiter copied to clipboard

"expire" option issue

Open malek0512 opened this issue 10 years ago • 2 comments

I have an issue with the middleware feature when "expire" option is not specified. X-RateLimit-Remaning is only decremented by 1. When I take a look to redis monitor with the command below

redis-cli monitor

I don't see any SET event, unlike the case when the "expire" option is specified. Is it Redis bug function ?

The code :

    var option = {
        lookup : 'user.id',
        total : '10'
    }
    router.get('/', limiter(option), action);

malek0512 avatar Aug 04 '15 15:08 malek0512

It's not a Redis, but, but maybe a library flaw of express-limiter. The fact is, you've left out a required field since you need to add expire

ded avatar Aug 04 '15 15:08 ded

Thank you for your quick response. My bad, I didn't notice that "expire" field was required. I should have read the documentation more carefully. However, it would be nice to have this as a feature.

malek0512 avatar Aug 06 '15 05:08 malek0512