OCA / odoorpc

Python module to pilot your Odoo servers through JSON-RPC.
http://pythonhosted.org/OdooRPC/
GNU Lesser General Public License v3.0
231 stars 123 forks source link

feat(auto-retry) #75

Open martintamare opened 2 years ago

martintamare commented 2 years ago

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 ?

martintamare commented 2 years ago

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 ;)

yajo commented 2 years ago

Don't you think an auto-retry might just increase the problem of too many requests?

martintamare commented 2 years ago

The patch specifically look for 429 errors and sleep exponentially before retrying, so no I don't think so ;)

martintamare commented 2 years ago

Thanks for the correction, it's not ready yet thow. I will fetch your changes and add the glue with the root object Odoo

martintamare commented 2 years ago

Added glue. Not sure if I should go kwargs all the way down to the proxy itself. I stopped at the Connector.

martintamare commented 2 years ago

I would also that setting autoretry to True by default can be good. At least for saas customers like us who use this library in dozen of scripts ... What do you think about that ?