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

Ignore rate limiter if no interval is supplied in order to avoid pseudo infinite loop #7

Merged
merged 2 commits into from
Oct 15, 2018

Conversation

Harrisonl
Copy link
Contributor

Currently, if no interval is supplied, the ratelimiter will enter an infinite loop as the default interval is 0, meaning ask_and_schedule will continuously call Process.send_after/3 with a delay of 0 (see screenshot below)
screen shot 2018-10-15 at 12 28 04 pm

This results in unnecessarily high CPU when idling. My rMBP had around 60% - 80% CPU usage on idle.

screen shot 2018-10-15 at 12 27 42 pm

Suggested solution is to completely bypass the rate limiter if there is no interval, and hook the consumer directly up to the producer

@coveralls
Copy link

Coverage Status

Coverage increased (+1.9%) to 100.0% when pulling fbc80ca on Harrisonl:master into 27c11c6 on fredwu:master.

@fredwu fredwu merged commit fbc98f8 into fredwu:master Oct 15, 2018
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