Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

The "slack" option doesn't make effect when use newAtomicInt64Based version rate limit #122

Open
nemohan opened this issue Dec 14, 2023 · 0 comments

Comments

@nemohan
Copy link

nemohan commented Dec 14, 2023

Use following test code:
func TestSlack2(t *testing.T) { rl := New(1, WithSlack(2)) // per second, some slack. rl.Take() // Initialize. time.Sleep(time.Second * 4) for i := 0; i < 100; i++ { rl.Take() fmt.Printf("%d\n", time.Now().Unix()) } }
I got those output:
1702546953
1702546953
1702546953
1702546953
1702546953
1702546953
1702546953
1702546953
1702546953
1702546953
1702546953
1702546953
1702546953
1702546953
....

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

No branches or pull requests

1 participant