SammyK / LaravelFacebookSdk

Fully unit tested Facebook SDK v5 integration for Laravel & Lumen
MIT License
692 stars 200 forks source link

Any way to time limit facebook reponse? Let say 1 sec? #153

Closed iggori closed 7 years ago

iggori commented 7 years ago

ErrorExceptionApp\Http\Controllers\FacebookController@facebookCallback warningfile_get_contents(https://graph.facebook.com/v2.6): failed to open stream: HTTP request failed! php

$response = $fb->sendBatchRequest($batch);

vendor/facebook/graph-sdk/src/Facebook/HttpClients/FacebookStream.php in handleError at line 75

 *
 * @return mixed
 */
public function fileGetContents($url)
{
    $rawResponse = file_get_contents($url, false, $this->stream);
    $this->responseHeaders = $http_response_header ?: [];
    return $rawResponse;
}

}

context { http_response_header: [ HTTP/1.1 504 Server timeout, Content-Type: text/html; charset=utf-8, Access-Control-Allow-Origin: *, Date: Mon, 02 Jan 2017 19:54:44 GMT, Connection: close, Content-Length: 2959 ], url: https://graph.facebook.com/v2.6 }

SammyK commented 7 years ago

Hey @iggori! Are you wanting to lower the default timeout of the HTTP client? There currently isn't an option for this unfortunately.