Replies: 3 comments 1 reply
|
Hey there! I feel your pain with those 5s timeouts on order responses. Since Session._client is private in v12, the 'clean' way would ideally be for the library to expose it, but a practical workaround many fellow devs use is to pass a custom httpx.Client or httpx.AsyncClient to the Session if the constructor allows it.\n\nIf it doesn't, you might have to temporarily reach into the private attribute (e.g., session._client.timeout = httpx.Timeout(10.0)) just to unblock yourself, though as you mentioned, it feels like a hack.\n\nIt might be worth opening a feature request to have timeout as a parameter in the Session config! Hope that helps. |
|
Feel free to open a PR to allow passing kwargs to the httpx client, just make sure it works when serialized/deserialized (and is backwards compatible with serialized sessions from the current version) |
|
Custom kwargs are now in v12.1.0, thanks for the PR! |
Uh oh!
There was an error while loading. Please reload this page.
Hi everyone,
I there some way to customise the timeout for the
httpxclient or requests in v12? I sometimes get the order response after the default 5sec, which makes it then quite tricky to track its state, as thePlacedOrderResponsecontains the all importantorder_id. In v11 I used to manually adjust the timeouts for the clients, but even there it seemed like a hack. And now even more so, withSession._clientbeing private.All reactions