odooly icon indicating copy to clipboard operation
odooly copied to clipboard

Support for timeout option

Open mbello opened this issue 6 years ago • 1 comments

Hi, thanks for odooly!

I am experienced with odoorpc and immediatelly I missed the timeout parameter when setting the connection parameters. Some requests take quite long and it is important to have a configurable timeout.

mbello avatar Jan 15 '19 20:01 mbello

There's 2 ways right now to customize the timeout:

  • globally as import socket; socket.setdefaulttimeout(10) https://docs.python.org/3/library/socket.html#socket.setdefaulttimeout
  • or use a custom transport for XML-RPC (example: https://github.com/tinyerp/erppeek/pull/70/files#diff-81ecbf8c9a00bca173b957866c5d5a69R331)

Maybe I'll add an optional argument to the Client as well, as an enhancement. The tricky part is that odooly.Client uses either urllib.request or xmlrpc.clientor requests depending on the context and the configuration.

florentx avatar Jan 16 '19 10:01 florentx