From 583c69662510ae9428657613f66e6ec995dfbd2d Mon Sep 17 00:00:00 2001 From: watzenare Date: Tue, 27 Jan 2015 12:13:22 +0100 Subject: [PATCH] Adding call timeout to the Curl RequestManager in order to detect when the api is down and receive an exception --- RequestManagers/CurlRequestManager.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/RequestManagers/CurlRequestManager.php b/RequestManagers/CurlRequestManager.php index 9b762d7..0cb1c0f 100644 --- a/RequestManagers/CurlRequestManager.php +++ b/RequestManagers/CurlRequestManager.php @@ -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);