wc-api-python icon indicating copy to clipboard operation
wc-api-python copied to clipboard

timeout increased to 10sec

Open Balaji-Kotni opened this issue 2 years ago • 3 comments

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.

Balaji-Kotni avatar Mar 03 '22 04:03 Balaji-Kotni

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
)

touhami92 avatar Apr 21 '22 07:04 touhami92

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
)

touhami92 avatar Apr 21 '22 07:04 touhami92

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

tvdsluijs avatar Jun 17 '23 08:06 tvdsluijs