Closed leihog closed 8 years ago
Thanks for the feedback @leihog - we'll look into getting this added in the next set up of updates :-)
BUMP, there are some progress on this issue @hobailey ?
@leihog @shakaran I suggest adding to https://github.com/Mangopay/mangopay2-php-sdk/blob/master/MangoPay/Libraries/RestTool.php#L179 something like:
curl_setopt($this->_curlHandle, CURLOPT_CONNECTTIMEOUT, 30);
curl_setopt($this->_curlHandle, CURLOPT_TIMEOUT, 80);
Would this satisfy your requirements? Or do you have any other suggestions/approaches you'd like to see added?
@hobailey for me it is a good patch. But it would be better if the 30 and 80 sec would be configurable by the user too, by global settings. See how Stripe is allowing to set the timeout for example too:
https://github.com/stripe/stripe-php/blob/master/lib/HttpClient/CurlClient.php#L98
Hi @shakaran, I've just updated the SDK - let me know if you have any feedback etc :-)
The current RestTool will block indefinitely as there is no timeout set. This isn't a problem when everything is working as it should, but it does become a problem when it's not. A 2-5s(or configurable) timeout value seems reasonable.