mirror of
https://github.com/searxng/searxng
synced 2024-01-01 18:24:07 +00:00
Merge pull request #745 from return42/hot-fix
[hotfix] interim fix to get docker-build of CI without issues
This commit is contained in:
commit
94736d7465
@ -13,4 +13,3 @@ uvloop==0.16.0
|
|||||||
httpx-socks[asyncio]==0.7.2
|
httpx-socks[asyncio]==0.7.2
|
||||||
langdetect==1.0.9
|
langdetect==1.0.9
|
||||||
setproctitle==1.2.2
|
setproctitle==1.2.2
|
||||||
redis==4.1.0
|
|
||||||
|
@ -20,7 +20,6 @@ A redis DB connect can be tested by::
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
import redis
|
|
||||||
from searx import get_setting
|
from searx import get_setting
|
||||||
|
|
||||||
logger = logging.getLogger('searx.shared.redis')
|
logger = logging.getLogger('searx.shared.redis')
|
||||||
@ -29,6 +28,8 @@ _client = None
|
|||||||
|
|
||||||
def client():
|
def client():
|
||||||
global _client # pylint: disable=global-statement
|
global _client # pylint: disable=global-statement
|
||||||
|
import redis # pylint: disable=import-error, import-outside-toplevel
|
||||||
|
|
||||||
if _client is None:
|
if _client is None:
|
||||||
# not thread safe: in the worst case scenario, two or more clients are
|
# not thread safe: in the worst case scenario, two or more clients are
|
||||||
# initialized only one is kept, the others are garbage collected.
|
# initialized only one is kept, the others are garbage collected.
|
||||||
@ -37,6 +38,8 @@ def client():
|
|||||||
|
|
||||||
|
|
||||||
def init():
|
def init():
|
||||||
|
import redis # pylint: disable=import-error, import-outside-toplevel
|
||||||
|
|
||||||
try:
|
try:
|
||||||
c = client()
|
c = client()
|
||||||
logger.info("connected redis DB --> %s", c.acl_whoami())
|
logger.info("connected redis DB --> %s", c.acl_whoami())
|
||||||
|
Loading…
Reference in New Issue
Block a user