sympy / sympy-bot-old

SymPy pull request helper
http://reviews.sympy.org/
Other
24 stars 16 forks source link

Factor out time doubling retry logic into a single function, keep_trying() #150

Closed asmeurer closed 11 years ago

asmeurer commented 11 years ago

See the docstring of keep_trying() for more information. The basic idea is that the function tries something, and if one of the given exceptions is raised, it prints an error message, sleeps, and then tries again. The time slept doubles with each failure, in order to prevent DoS. It also supports doing additional error handling when the error is caught.

Note that I haven't tested all the behavior yet. In particular, I am currently at my GitHub API quota, so I can't test that the code to fail gracefully when a pull request is really an issue works. If someone can try sympy-bot review 1778 with this, that should tell you.

I also didn't test that it does the right thing if the reviews site is over quota, though I probably should. I'm not sure what the best way to test that would be.

asmeurer commented 11 years ago

I verified it works for issues. Let's make sure I did the code correctly for over quota reviews site, though.

asmeurer commented 11 years ago

I still need to test my latest fix.

asmeurer commented 11 years ago

I think it's working. I'm getting Could not access http://reviews.sympy.org, retrying in 1 seconds... (not sure why, but at least it isn't crashing).

jrioux commented 11 years ago

Worked fine for me too.