add timeout support to upwork.client#5
Conversation
|
@michael-yin , thanks for the patch! |
|
Based on my experience, the default timeout for software which have socket connection is usually 30-60 secs by default. Many developers do not set timeout when using this api, so my suggestion is we can set the default to a high value but not a low value. If a programmer met timeout exception, he will first check the network but not change the timeout value to a higher value. Which might make them confused. |
|
Having a high value for timeout option is a really poor practise - if smth goes wrong, such requests will hang out and may overload server's pool We can accept the patch only with small value - in case someone need a high one, he will be able to setup it in his own code |
|
Ok, I have modified the code as you asked, I think it can be merged now. |
add timeout support to upwork.client
|
@michael-yin , good job! 👍 |
When I am using python upwork api, I found sometime the program was blocked because of the unstable network. So I think it really make sense to make the client can support timeout setting.