|
@@ -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
|
|
global _client
|
|
|
|
+ import redis
|
|
|
|
+
|
|
if _client is None:
|
|
if _client is None:
|
|
|
|
|
|
|
|
|
|
@@ -37,6 +38,8 @@ def client():
|
|
|
|
|
|
|
|
|
|
def init():
|
|
def init():
|
|
|
|
+ import redis
|
|
|
|
+
|
|
try:
|
|
try:
|
|
c = client()
|
|
c = client()
|
|
logger.info("connected redis DB --> %s", c.acl_whoami())
|
|
logger.info("connected redis DB --> %s", c.acl_whoami())
|