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

Fix allowance calculation which always return 0 in some circumstances. #6

Merged
merged 1 commit into from
Dec 14, 2017

Conversation

Fifan31
Copy link

@Fifan31 Fifan31 commented Dec 14, 2017

Indeed, in the consume function from TokenBucket, when per is greater than rate, the division of rate by per returns 0 (in python 2.x)
Import division solves the problem

Indeed, when per is greater than rate, the division of rate by per returns 0 (in python 2.x)
Import division solve the problem
@alexcreid
Copy link

I've also been impacted by this today, and tracked down the same problem. What a spooky coincidence 👻

I'm hoping to work around it in the meantime by making my values for rate and per floats to begin with in my logging config.

@wkeeling wkeeling merged commit c0cf250 into wkeeling:master Dec 14, 2017
@wkeeling
Copy link
Owner

Thanks guys - have merged.

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.

4 participants