roguesupport / oauth-php

The original OAUTH standard implemented in PHP (Historic Record)
MIT License
0 stars 0 forks source link

Timeout setting #47

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Today foursquare was updating their service. Therefore their servers could
not be reached within the PHP max_execution_time (30 secs in this case).
This resulted in my entire application going down.
I looked but didn't find for a setting that allowed me to set a timeout for
the request. When a timeout occurs it should throw an exception which I can
catch and handle appropriately.
I would like to know if I misread the code. Otherwise this would be a
feature request.
Any feedback is welcome. Thank you in advance.

Original issue reported on code.google.com by r.weste...@gmail.com on 28 May 2010 at 10:29

GoogleCodeExporter commented 9 years ago
Try ini_set('max_execution_time', ...) or set it in php.ini file directly. 
Another way is to call

http://php.net/manual/en/function.set-time-limit.php

before the 30 seconds are over. This will reset php´s internal script 
execution timer. There´s no other way to 
handle this.

Original comment by fiedler....@gmail.com on 29 May 2010 at 6:54

GoogleCodeExporter commented 9 years ago
The requests are being sent with cURL. I think CURLOPT_TIMEOUT could be used to 
set a
timeout. This way unresponsive servers can be detected.

Original comment by r.weste...@gmail.com on 30 May 2010 at 1:18

GoogleCodeExporter commented 9 years ago
Yes, you can use CURLOPT_TIMEOUT. You can pass it as an extra curl_option, but 
I just
patched (r129) to have a default timeout of 30 seconds. Thanks for the report!

Original comment by brunobg%...@gtempaccount.com on 4 Jun 2010 at 2:47