|
@@ -24,10 +24,16 @@ import redis
|
|
from searx import get_setting
|
|
from searx import get_setting
|
|
|
|
|
|
logger = logging.getLogger('searx.shared.redis')
|
|
logger = logging.getLogger('searx.shared.redis')
|
|
|
|
+_client = None
|
|
|
|
|
|
|
|
|
|
def client():
|
|
def client():
|
|
- return redis.Redis.from_url(get_setting('redis.url'))
|
|
+ global _client
|
|
|
|
+ if _client is None:
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ _client = redis.Redis.from_url(get_setting('redis.url'))
|
|
|
|
+ return _client
|
|
|
|
|
|
|
|
|
|
def init():
|
|
def init():
|