LibreY

- privacy respecting meta search engine
git clone git://git.acid.vegas/LibreY.git
Log | Files | Refs | Archive | README | LICENSE

commit 039e549d4ce11143521b7909bcb563b9ea178cc3
parent f50022f7807683aaaa4e72dd78123e575baf6a6c
Author: davidovski <david@davidovski.xyz>
Date: Fri, 25 Aug 2023 17:48:45 +0100

Change default timeout to 25 minutes

Diffstat:
Mconfig.php.example | 6+++---
Mengines/librex/fallback.php | 8--------
Mengines/text/text.php | 1-
Mmisc/cooldowns.php | 1-

4 files changed, 3 insertions(+), 13 deletions(-)

diff --git a/config.php.example b/config.php.example
@@ -17,11 +17,11 @@
         "disable_hidden_service_search" => false,
 
         // Fallback to another librex instance if google search fails
-        // This may greatly increase the time it takes to get a result and in some cases results in 504 errors
-        "instance_fallback" => false,
+        // This may greatly increase the time it takes to get a result, if a direct search is not possible
+        "instance_fallback" => true,
 
         // how long in minutes to put google/other instances on cooldown if they aren't responding
-        "request_cooldown" => 5,
+        "request_cooldown" => 25,
 
         /*
             Preset privacy friendly frontends for users, these can be overwritten by users in the settings
diff --git a/engines/librex/fallback.php b/engines/librex/fallback.php
@@ -37,13 +37,6 @@
             return array();
 
         $cooldowns = $opts->cooldowns;
-        error_log("loaded" . count($cooldowns));
-        error_log(print_r($cooldowns,true));
-
-        echo "<pre>";
-        print_r($cooldowns);
-        echo "</pre>";
-
         $instances = load_instances($cooldowns);
 
         $results = array();
@@ -54,7 +47,6 @@
 
             $instance = array_pop($instances);
 
-            error_log($instance .  "--- " . parse_url($instance)["host"]);
             if (parse_url($instance)["host"] == parse_url($_SERVER['HTTP_HOST'])["host"])
                 continue;
 
diff --git a/engines/text/text.php b/engines/text/text.php
@@ -34,7 +34,6 @@
             if (!$this->engine_request)
                 return array();
 
-            error_log("fetching googl results");
             $results = $this->engine_request->get_results();
 
             if ($this->special_request) {
diff --git a/misc/cooldowns.php b/misc/cooldowns.php
@@ -9,7 +9,6 @@
 
     function set_cooldown($instance, $timeout, $cooldowns) {
         $cooldowns[$instance] = time() + $timeout;
-        error_log("cooldown on instnace $instance for $timeout seconds");
         save_cooldowns($cooldowns);
         return $cooldowns;
     }