Skip to content

Commit

Permalink
Adding call timeout to the Curl RequestManager in order to detect whe…
Browse files Browse the repository at this point in the history
…n the api is down and receive an exception
  • Loading branch information
watzenare committed Jan 27, 2015
1 parent 7c5b04c commit 583c696
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions RequestManagers/CurlRequestManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,8 @@ public function getAppAuth()
curl_setopt($ch, CURLOPT_URL, $this->getBaseUrl() . $path);
curl_setopt($ch, CURLOPT_PORT, $this->getPort());
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
// Setting timeout that throws exception when the PushApi is down
curl_setopt($ch, CURLOPT_TIMEOUT, 2000);

curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);

Expand Down

0 comments on commit 583c696

Please sign in to comment.