diff --git a/lib/IntaroCrm/RestApi.php b/lib/IntaroCrm/RestApi.php index 2dc6d98..c8f8518 100644 --- a/lib/IntaroCrm/RestApi.php +++ b/lib/IntaroCrm/RestApi.php @@ -442,9 +442,18 @@ class RestApi $result = $this->curlRequest($url); return $result; } - - - + + /** + * Обновление статистики + * + * @return array - статус вып обновления + */ + public function statisticUpdate() + { + $url = $this->apiUrl.'statistic/update'; + $result = $this->curlRequest($url); + return $result; + } protected function curlRequest($url, $method = 'GET', $format = 'json') { @@ -456,7 +465,7 @@ class RestApi curl_setopt($ch, CURLOPT_FAILONERROR, FALSE); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);// allow redirects curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // return into a variable - curl_setopt($ch, CURLOPT_TIMEOUT, 3); // times out after 3s + curl_setopt($ch, CURLOPT_TIMEOUT, 30); // times out after 30s if ($method == 'POST') {