Skip to content
Snippets Groups Projects
Commit 1da9f3a2 authored by Dominik Hebeler's avatar Dominik Hebeler
Browse files

removed fresh connection

parent 52d880b1
No related branches found
No related tags found
No related merge requests found
......@@ -33,12 +33,6 @@ class RequestFetcher extends Command
protected $proxyuser;
protected $proxypassword;
/**
* If we receive an status code 0 in a curl fetch (timeout, etc.) the name of the fetcher (yahoo, adgoal, etc) will get stored
* in this array. And causes the next fetch to establish a fresh connection.
*/
protected $error_connections = [];
/**
* Create a new command instance.
*
......@@ -169,12 +163,6 @@ class RequestFetcher extends Command
$body = \curl_multi_getcontent($info["handle"]);
}
if ($responseCode === 0) {
$this->error_connections[$name] = true;
} else {
$this->error_connections[$name] = false;
}
Redis::pipeline(function ($pipe) use ($resulthash, $body, $cacheDurationMinutes) {
$pipe->lpush($resulthash, $body);
$pipe->expire($resulthash, 60);
......@@ -217,11 +205,6 @@ class RequestFetcher extends Command
curl_setopt_array($ch, $job["curlopts"]);
}
if (!empty($this->error_connections[$job["name"]]) && $this->error_connections[$job["name"]] === true) {
Log::info("Using a fresh Curl connection for " . $job["name"]);
curl_setopt($ch, \CURLOPT_FRESH_CONNECT, true);
}
if (!empty($this->proxyhost) && !empty($this->proxyport)) {
curl_setopt($ch, CURLOPT_PROXY, $this->proxyhost);
if (!empty($this->proxyuser) && !empty($this->proxypassword)) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment