Skip to content

Conversation

Balaji-Kotni
Copy link

before timeout set to 5sec its very low some times if network is not good getting this error :

raise ReadTimeout(e, request=request)
requests.exceptions.ReadTimeout: HTTPSConnectionPool(host='......', port=....): Read timed out. (read timeout=5)

for every two request i am getting this problem so i increased the timeout to 10 sec...

Thank you.

before timeout set to 5sec its very low some times if network is not good getting this error : 
raise ReadTimeout(e, request=request)
requests.exceptions.ReadTimeout: HTTPSConnectionPool(host='......', port=....): Read timed out. (read timeout=5)


for every two request i am getting this problem so i increased the timeout to 10 sec...

Thank you.
@touhami92
Copy link

no need to change the default value; it is possible to create an instance with a timeout=10

wcapi = API(
    url="http://example.com",
    consumer_key="ck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
    consumer_secret="cs_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
    version="wc/v3",
    timeout=10
)

1 similar comment
@touhami92
Copy link

no need to change the default value; it is possible to create an instance with a timeout=10

wcapi = API(
    url="http://example.com",
    consumer_key="ck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
    consumer_secret="cs_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
    version="wc/v3",
    timeout=10
)

@ghost
Copy link

ghost commented Jun 17, 2023

It would also be nice if there would be a retry mechanism for when you get a 443 (timeout) after all

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants