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

Merge branch '485-ux-bei-such-timeout' into 'development'

Boost Knopf von der Startseite entfernt

Closes #485

See merge request !855
parents 80f57c8e ae117cec
No related branches found
No related tags found
1 merge request!1365Resolve "Filter Options for MetaGer"
......@@ -14,7 +14,7 @@ class Searcher implements ShouldQueue
{
use InteractsWithQueue, Queueable, SerializesModels;
protected $name, $ch, $pid, $counter, $lastTime;
protected $name, $ch, $pid, $counter, $lastTime, $connectionInfo;
protected $MAX_REQUESTS = 100;
protected $importantEngines = array("Fastbot", "overture", "overtureAds");
protected $recheck;
......@@ -64,9 +64,7 @@ class Searcher implements ShouldQueue
$this->updateStats(microtime(true) - $time);
$this->switchToRunning();
// The mission can be empty when blpop hit the timeout
if(empty($mission)){
continue;
}else{
if(!empty($mission)){
$mission = $mission[1];
$poptime = microtime(true) - $time;
......@@ -121,7 +119,7 @@ class Searcher implements ShouldQueue
}
}
private function updateStats($poptime){
$connectionInfo = base64_encode(json_encode(curl_getinfo($this->ch), true));
$connectionInfo = base64_encode(json_encode($this->connectionInfo));
Redis::hset($this->name . ".stats", $this->pid, $connectionInfo . ";" . $poptime);
}
......@@ -144,8 +142,8 @@ class Searcher implements ShouldQueue
private function retrieveUrl($url){
// Set this URL to the Curl handle
curl_setopt($this->ch, CURLOPT_URL, $url);
$result = curl_exec($this->ch);
$this->connectionInfo = curl_getinfo($this->ch);
return $result;
}
......
......@@ -155,6 +155,7 @@ abstract class Searchengine
// of course need to spawn a new one.
if(sizeof($searcherData) === 0){
$needSearcher = true;
Log::info("Request new Searcher beacause none is running");
}else{
// There we go:
// There's at least one Fetcher running for this search engine.
......@@ -170,6 +171,7 @@ abstract class Searchengine
$median /= sizeof($searcherData);
if($median < .1){
$needSearcher = true;
Log::info("Requesting new Searcher because: $median \n" . print_r($searcherData, true));
}
}
if($needSearcher && Redis::get($this->name) !== "locked"){
......
......@@ -304,8 +304,6 @@
</form>
</fieldset>
<ul class="list-inline searchform-bonus">
<li><a href="https://www.boost-project.com/de/shops?charity_id=1129&amp;tag=bl" target="_blank" rel="noopener" id="foerdershops" class="btn btn-default mutelink" title="{{ trans('index.partnertitle') }}"><i class="fa fa-shopping-bag" aria-hidden="true"></i> {{ trans('index.conveyor') }}</a></li>
<li class="hidden-xs seperator">|</li>
<li id="plug"
@unless ($browser === 'Firefox' || $browser === 'Mozilla' || $browser === 'Chrome' || $browser === 'Opera' || $browser === 'IE' || $browser === 'Edge' || $browser === 'Safari' || $browser === 'Vivaldi')
class="hidden"
......
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