+statisticUpdate; +30s timeout
This commit is contained in:
parent
a647993272
commit
7ac3170b76
@ -442,9 +442,18 @@ class RestApi
|
|||||||
$result = $this->curlRequest($url);
|
$result = $this->curlRequest($url);
|
||||||
return $result;
|
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')
|
protected function curlRequest($url, $method = 'GET', $format = 'json')
|
||||||
{
|
{
|
||||||
@ -456,7 +465,7 @@ class RestApi
|
|||||||
curl_setopt($ch, CURLOPT_FAILONERROR, FALSE);
|
curl_setopt($ch, CURLOPT_FAILONERROR, FALSE);
|
||||||
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);// allow redirects
|
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);// allow redirects
|
||||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // return into a variable
|
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')
|
if ($method == 'POST')
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user