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 smart throttle, allow disabling it #283

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions monocle/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -889,6 +889,8 @@ async def visit_point(self, point, spawn_id, bootstrap,
return pokemon_seen + forts_seen + points_seen

def smart_throttle(self, requests=1):
if not conf.SMART_THROTTLE:
return True
try:
# https://en.wikipedia.org/wiki/Linear_equation#Two_variables
# e.g. hashes_left > 2.25*seconds_left+7.5, spare = 0.05, max = 150
Expand Down