Closed asmeurer closed 11 years ago
I verified it works for issues. Let's make sure I did the code correctly for over quota reviews site, though.
I still need to test my latest fix.
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).
Worked fine for me too.
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.