Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

redis_rate.PerDay() ?? #81

Open
canalun opened this issue Mar 13, 2023 · 3 comments
Open

redis_rate.PerDay() ?? #81

canalun opened this issue Mar 13, 2023 · 3 comments

Comments

@canalun
Copy link

canalun commented Mar 13, 2023

Hi, thank you for developing this really useful rate limiter!! I'm now about to use this library😃

And I thought what about supporting redis_rate.PerDay().
As you know, currently, we have only choices of PerSec(), PerMin() and PerHour(). However, some ppl (not only me, maybe) might wanna set limits per day.

If it doesn't sound like a bad idea, if I may, I would like to work on it😊
Would be really happy if you gave me a reply...!

@tony95271
Copy link

Hi, thank you for developing this really useful rate limiter!! I'm now about to use this library😃

And I thought what about supporting redis_rate.PerDay(). As you know, currently, we have only choices of PerSec(), PerMin() and PerHour(). However, some ppl (not only me, maybe) might wanna set limits per day.

If it doesn't sound like a bad idea, if I may, I would like to work on it😊 Would be really happy if you gave me a reply...!

you could walk around this issue
https://github.com/tonytony2020/redis_rate/wiki#usage

@tanto-satu
Copy link

tanto-satu commented Nov 9, 2023

is there any follow up regarding this issue? or can somebody provide some example to do it for perDay?

@tikhomirovv
Copy link

tikhomirovv commented Jun 19, 2024

@tanto-satu, I suppose it should be like this:

// limit := redis_rate.PerMinute(rate)
limit := redis_rate.Limit{
        Rate:   rate,
        Burst:  rate,
        Period: time.Hour * 24,
}

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants