Skip to content

Conversation

@amanda94
Copy link
Contributor

@amanda94 amanda94 commented Jul 20, 2018

I add a test for my example and change the get function where every time accessing the sorted sets deleting the old data by score

Closes #3

@Kikobeats
Copy link
Member

Thanks for that! I'm reviewing it and will be merge soon 🙂

@microlinkhq microlinkhq deleted a comment from coveralls Jul 21, 2018
@microlinkhq microlinkhq deleted a comment from coveralls Jul 21, 2018
@Kikobeats
Copy link
Member

I want to know the opinion @xdmnl because I want to integrate his recent PR: tj/node-ratelimiter#44

In your comment, you are suggesting use zremrangebyscore. Can both improvement life together? do you think that integrate your PR make necessary this one?

@xdmnl
Copy link

xdmnl commented Jul 22, 2018

It is a trade-off between keeping all the data and do 2 reads or keeping only the maximum of timestamps requested by the limiter and then doing only 1 read.
I like the first option (the one that I proposed) better because it reflects reality. If the delay is small enough, the difference won't be noticeable.

In any case, this PR is necessary. It fixes a bug that does not exist in the original library: not expiring out of date timestamps.

@Kikobeats Kikobeats merged commit f078d28 into microlinkhq:master Jul 23, 2018
@Kikobeats
Copy link
Member

Thanks for the feedback guys, released at 1.1.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants