From 1114713492899331428b016a95ba2ffa458e4f1f Mon Sep 17 00:00:00 2001
From: Dominik Hebeler <dominik@suma-ev.de>
Date: Wed, 6 Mar 2019 14:41:53 +0100
Subject: [PATCH] Changed the Expire to use specified timeout in env file

---
 app/Http/Controllers/MetaGerSearch.php | 4 ++--
 app/Models/Searchengine.php            | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/app/Http/Controllers/MetaGerSearch.php b/app/Http/Controllers/MetaGerSearch.php
index f46c4331c..3596d29bf 100644
--- a/app/Http/Controllers/MetaGerSearch.php
+++ b/app/Http/Controllers/MetaGerSearch.php
@@ -55,7 +55,7 @@ class MetaGerSearch extends Controller
         foreach ($metager->getResults() as $result) {
             $pipeline->rpush($metager->getRedisCurrentResultList(), base64_encode(serialize($result)));
         }
-        $pipeline->expire($metager->getRedisCurrentResultList(), 6000);
+        $pipeline->expire($metager->getRedisCurrentResultList(), env('REDIS_RESULT_CACHE_DURATION'));
         $pipeline->execute();
 
         # Die Ausgabe erstellen:
@@ -154,7 +154,7 @@ class MetaGerSearch extends Controller
                 $resultTmp->new = false;
                 $pipeline->rpush($metager->getRedisCurrentResultList(), base64_encode(serialize($resultTmp)));
             }
-            $pipeline->expire($metager->getRedisCurrentResultList(), 6000);
+            $pipeline->expire($metager->getRedisCurrentResultList(), env('REDIS_RESULT_CACHE_DURATION'));
             $pipeline->execute();
 
         }
diff --git a/app/Models/Searchengine.php b/app/Models/Searchengine.php
index 991da0595..f6bacb096 100644
--- a/app/Models/Searchengine.php
+++ b/app/Models/Searchengine.php
@@ -109,7 +109,7 @@ abstract class Searchengine
             $redis = Redis::connection(env('REDIS_RESULT_CONNECTION'));
             // We will push the confirmation of the submission to the Result Hash
             $redis->hset($metager->getRedisEngineResult() . $this->name, "status", "waiting");
-            $redis->expire($metager->getRedisEngineResult() . $this->name, 60);
+            $redis->expire($metager->getRedisEngineResult() . $this->name, env('REDIS_RESULT_CACHE_DURATION'));
 
             // We need to submit a action that one of our workers can understand
             // The missions are submitted to a redis queue in the following string format
-- 
GitLab