[nominatim-web] Flush redis only if expired some entries



commit bafe5b7b80175c0fbbe12f475e01e01983a88c26
Author: Bartłomiej Piotrowski <bpiotrowski gnome org>
Date:   Sat Apr 10 21:29:24 2021 +0200

    Flush redis only if expired some entries

 app/main.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/app/main.py b/app/main.py
index 7aefd97..0601f70 100644
--- a/app/main.py
+++ b/app/main.py
@@ -156,6 +156,7 @@ def expire():
         reverse = cur.rowcount
         postgres.commit()
 
-    redis_conn.flushall()
+    if search > 0 or reverse > 0:
+        redis_conn.flushall()
 
     return {"search": search, "reverse": reverse}


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]