-
-
Notifications
You must be signed in to change notification settings - Fork 134
feat(auto-retry) #75
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
base: master
Are you sure you want to change the base?
feat(auto-retry) #75
Conversation
|
This is a basic implemention. I will try to add test and glue all the pieces together once I know I'm on the right way ;) |
|
Don't you think an auto-retry might just increase the problem of too many requests? |
|
The patch specifically look for 429 errors and sleep exponentially before retrying, so no I don't think so ;) |
|
Thanks for the correction, it's not ready yet thow. I will fetch your changes and add the glue with the root object Odoo |
|
Added glue. |
|
I would also that setting autoretry to True by default can be good. |
| # Default autoretry for .odoo.com (saas) hosts | ||
| if 'autoretry' in kwargs: | ||
| self._autoretry = kwargs['autoretry'] | ||
| elif host.endswith('.odoo.com'): | ||
| self._autoretry = True | ||
| else: | ||
| self._autoretry = False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't particularly like this kind of magic. But in case it were, then you can default the autoretry arg to None, enabling this magic, insteado of relying in the existence of the kwarg. It would be the same result, but simplify the methods signature.
Making things obvious and predictable is good IMHO.
In any case, this (and the rest of the feature) deserves an entry in the docs.
When 429 error, auto retry the requests.
5d19816 to
8015046
Compare
yajo
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some typos
Co-authored-by: Jairo Llopis <973709+yajo@users.noreply.github.com>
Co-authored-by: Jairo Llopis <973709+yajo@users.noreply.github.com>
Co-authored-by: Jairo Llopis <973709+yajo@users.noreply.github.com>
Co-authored-by: Jairo Llopis <973709+yajo@users.noreply.github.com>
Co-authored-by: Jairo Llopis <973709+yajo@users.noreply.github.com>
With the latest odoo I start to have a lot of HTTPError 429 Too Many Request.
What do you think of this implementation of an auto-retry ?