odooly
odooly copied to clipboard
Support for timeout option
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.
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.client
or requests
depending on the context and the configuration.