From 50c4b58db652f4ed5b257bd758d54286e743d97f Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Wed, 12 Jan 2022 09:17:03 +0100 Subject: [PATCH] [hotfix] interim fix to get docker-build of CI without issues There is an issue with redis v4.1.0 [1] / for the interim lets remove this python dependency. [1] https://github.com/searxng/searxng/issues/741 Signed-off-by: Markus Heiser --- requirements.txt | 1 - searx/shared/redisdb.py | 5 ++++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/requirements.txt b/requirements.txt index 0f9c5aa04..20aa4e34c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -13,4 +13,3 @@ uvloop==0.16.0 httpx-socks[asyncio]==0.7.2 langdetect==1.0.9 setproctitle==1.2.2 -redis==4.1.0 diff --git a/searx/shared/redisdb.py b/searx/shared/redisdb.py index da71d169c..d6a4dc3bf 100644 --- a/searx/shared/redisdb.py +++ b/searx/shared/redisdb.py @@ -20,7 +20,6 @@ A redis DB connect can be tested by:: """ import logging -import redis from searx import get_setting logger = logging.getLogger('searx.shared.redis') @@ -29,6 +28,8 @@ _client = None def client(): global _client # pylint: disable=global-statement + import redis # pylint: disable=import-error, import-outside-toplevel + if _client is None: # not thread safe: in the worst case scenario, two or more clients are # initialized only one is kept, the others are garbage collected. @@ -37,6 +38,8 @@ def client(): def init(): + import redis # pylint: disable=import-error, import-outside-toplevel + try: c = client() logger.info("connected redis DB --> %s", c.acl_whoami())