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

Sleeps after last unsuccessful call to target before raising MaxCallException #11

Open
troyhoffman opened this issue Oct 11, 2018 · 4 comments

Comments

@troyhoffman
Copy link

Example code:
``def target_method():
print('called')
return False

poll(target_method, step=5, max_tries=2)``

Behavior:
Prints "called", waits 5 seconds, prints "called", waits 5 seconds, raises polling.MaxCallException

Expected:
Prints "called", waits 5 seconds, prints "called", raises polling.MaxCallException immediately

The problem will be more noticeable with a high step value. With a step value of 300, it will wait 5 minutes between failing and raising the exception. Fix is to move the check and raise to before the sleep instead of the top of the loop.

@troyhoffman
Copy link
Author

Pull request created (#12)

@troyhoffman
Copy link
Author

My PR was failing CI. Looking into this, since it passed the tests locally.

@ddmee
Copy link

ddmee commented Jun 4, 2019

This has been fixed in https://pypi.org/project/polling2/

@VeNoMouS
Copy link

VeNoMouS commented Mar 3, 2020

@justiniso are you going to address this issue?

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

3 participants