Skip to content

Commit

Permalink
Merge pull request #742 from campusdomar/feature_18200_set_more_timeo…
Browse files Browse the repository at this point in the history
…ut_for_received_data_from_oc

TTK-18200 set more timeout to receive data from oc
  • Loading branch information
mreyk authored Jun 6, 2018
2 parents 9118bd4 + e4c51cc commit fc3bab5
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/Pumukit/OpencastBundle/Services/ClientService.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ public function getMediaPackages($query, $limit, $offset)
{
$output = $this->request('/search/episode.json?'.($query ? 'q='.urlencode($query).'&' : '').'limit='.$limit.'&offset='.$offset);

if ($output['status'] !== 200) {
if (200 !== $output['status']) {
return false;
}
$decode = $this->decodeJson($output['var']);
Expand Down Expand Up @@ -177,7 +177,7 @@ public function getMediapackage($id)
{
$output = $this->request('/search/episode.json?id='.$id);

if ($output['status'] !== 200) {
if (200 !== $output['status']) {
return false;
}
$decode = $this->decodeJson($output['var']);
Expand All @@ -204,7 +204,7 @@ public function getFullMediapackage($id)
{
$output = $this->request('/search/episode.json?id='.$id);

if ($output['status'] !== 200) {
if (200 !== $output['status']) {
return false;
}
$decode = $this->decodeJson($output['var']);
Expand All @@ -231,10 +231,10 @@ public function getMediapackageFromArchive($id)
{
$output = $this->request('/episode/episode.json?id='.$id, array(), 'GET', true);

if ($output['status'] !== 200) {
if (200 !== $output['status']) {
$output = $this->request('/archive/episode.json?id='.$id, array(), 'GET', true);

if ($output['status'] !== 200) {
if (200 !== $output['status']) {
return false;
}
}
Expand Down Expand Up @@ -285,7 +285,7 @@ public function applyWorkflowToMediaPackages(array $mediaPackagesIds = array(),

$output = $this->request($request, $parameters, 'POST', true);

if ($output['status'] !== 204) {
if (204 !== $output['status']) {
return false;
}

Expand All @@ -303,7 +303,7 @@ public function getWorkflowStatistics()

$output = $this->request($request, array(), 'GET', true);

if ($output['status'] !== 200) {
if (200 !== $output['status']) {
return false;
}

Expand All @@ -326,7 +326,7 @@ public function getCountedWorkflowInstances($id = '', $count = '', $workflowName

$output = $this->request($request, array(), 'GET', true);

if ($output['status'] !== 200) {
if (200 !== $output['status']) {
return false;
}

Expand All @@ -349,7 +349,7 @@ public function stopWorkflow(array $workflow = array())
$request = '/workflow/stop';
$params = array('id' => $workflow['id']);
$output = $this->request($request, $params, 'POST', true);
if ($output['status'] !== 200) {
if (200 !== $output['status']) {
return false;
}

Expand Down Expand Up @@ -511,13 +511,13 @@ private function request($path, $params = array(), $method = 'GET', $useAdminUrl
curl_setopt($request, CURLOPT_RETURNTRANSFER, true);
curl_setopt($request, CURLOPT_FOLLOWLOCATION, false);
curl_setopt($request, CURLOPT_CONNECTTIMEOUT, 1);
curl_setopt($request, CURLOPT_TIMEOUT, 1);
curl_setopt($request, CURLOPT_TIMEOUT, 10);

if ($this->insecure) {
curl_setopt($request, CURLOPT_SSL_VERIFYPEER, false);
}

if ($this->user != '') {
if ('' != $this->user) {
curl_setopt($request, CURLOPT_HTTPAUTH, CURLAUTH_DIGEST);
curl_setopt($request, CURLOPT_USERPWD, $this->user.':'.$this->passwd);
curl_setopt($request, CURLOPT_HTTPHEADER, $header);
Expand All @@ -530,7 +530,7 @@ private function request($path, $params = array(), $method = 'GET', $useAdminUrl

curl_close($request);

if ($method == 'GET') {
if ('GET' == $method) {
if (200 != $output['status']) {
$this->logger->addError(__CLASS__.'['.__FUNCTION__.'](line '.__LINE__
.') Error ('.$output['status'].') Processing Request : '.$requestUrl.'.');
Expand Down

0 comments on commit fc3bab5

Please sign in to comment.