mirror of
https://github.com/searxng/searxng.git
synced 2025-07-13 00:09:18 +02:00
Initialize Redis in searx/webapp.py
settings.yml: * The default URL was unix:///usr/local/searxng-redis/run/redis.sock?db=0 * The default URL is now "false" The default URL makes the log difficult to deal with: if the admin didn't install a Redis instance, the logs record a false error. It worked before because SearXNG initialized the Redis connection when the limiter started. In this commit, SearXNG initializes Redis in searx/webapp.py so various components can use Redis without taking care of the initialization step.
This commit is contained in:
parent
fe419e355b
commit
e92755d358
7 changed files with 36 additions and 24 deletions
|
@ -29,6 +29,6 @@ if os.path.isfile(OLD_SETTING):
|
|||
from searx.shared import redisdb
|
||||
from searx import get_setting
|
||||
|
||||
if not redisdb.init():
|
||||
if not redisdb.initialize():
|
||||
warnings.warn("can't connect to redis DB at: %s" % get_setting('redis.url'), RuntimeWarning, stacklevel=2)
|
||||
warnings.warn("--> no bot protection without redis DB", RuntimeWarning, stacklevel=2)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue