Skip to content

Commit

Permalink
Revert "[hotfix] interim fix to get docker-build of CI without issues"
Browse files Browse the repository at this point in the history
This reverts interim fix from commit 50c4b58 and adds requirement
`redis==4.1.1`.

The interim fix was needed by Alpine images (Docker) [1] and has been fixed in
commit [2] merged with the patch series from [3].  In redis-py version 4.1.1
this pach has been released on PyPi [4].

[1] redis/redis-py#1869
[2] redis/redis-py@1fc1233f
[3] redis/redis-py#1854
[4] redis/redis-py#1880

Signed-off-by: Markus Heiser <[email protected]>
  • Loading branch information
return42 committed Jan 17, 2022
1 parent 96ab5e5 commit e85744c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ uvloop==0.16.0
httpx-socks[asyncio]==0.7.2
langdetect==1.0.9
setproctitle==1.2.2
redis==4.1.1
5 changes: 1 addition & 4 deletions searx/shared/redisdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"""

import logging
import redis
from searx import get_setting

logger = logging.getLogger('searx.shared.redis')
Expand All @@ -28,8 +29,6 @@

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.
Expand All @@ -38,8 +37,6 @@ 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())
Expand Down

0 comments on commit e85744c

Please sign in to comment.