diff --git a/app/Jobs/Searcher.php b/app/Jobs/Searcher.php index 8a1e87a86adda6ebf02f406046d7d3dc422b292a..ba00d6cf4f77e705ec44ff01f3d28304f5ee701d 100644 --- a/app/Jobs/Searcher.php +++ b/app/Jobs/Searcher.php @@ -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; } diff --git a/app/Models/Searchengine.php b/app/Models/Searchengine.php index 6f6cf9ba75820a06bc15ec68a0dbb3889c106e5b..488bfd18fdb12cf1b6482acd7c4a8a3164565b89 100644 --- a/app/Models/Searchengine.php +++ b/app/Models/Searchengine.php @@ -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"){ diff --git a/resources/views/index.blade.php b/resources/views/index.blade.php index 955e744daffc4cbc0cd988e50ea1094d21d78609..cb322c778b90ec0a7bfaf6a9f19660e96d8a9111 100644 --- a/resources/views/index.blade.php +++ b/resources/views/index.blade.php @@ -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&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"