summaryrefslogtreecommitdiff
path: root/searx
diff options
context:
space:
mode:
authorAlexandre Flament <alex@al-f.net>2022-11-11 21:58:32 +0100
committerAlexandre Flament <alex@al-f.net>2022-12-10 09:26:38 +0100
commitb971167ced9623c038188ae7bf5a8085147bc35d (patch)
treed82d7fb4bad9d67b048bce8985cc4a3f09268503 /searx
parent34e260f88f561cf26454fe72a10a3a403faf2ff3 (diff)
downloadsearxng-b971167ced9623c038188ae7bf5a8085147bc35d.tar.gz
searxng-b971167ced9623c038188ae7bf5a8085147bc35d.zip
move searx.shared.redisdb to searx.redisdb
Diffstat (limited to 'searx')
-rw-r--r--searx/plugins/limiter.py2
-rw-r--r--searx/redisdb.py (renamed from searx/shared/redisdb.py)6
-rw-r--r--searx/search/checker/background.py2
-rw-r--r--searx/search/checker/scheduler.py2
-rw-r--r--searx/shared/__init__.py6
-rwxr-xr-xsearx/webapp.py2
6 files changed, 7 insertions, 13 deletions
diff --git a/searx/plugins/limiter.py b/searx/plugins/limiter.py
index c11fd506b..b66a0805c 100644
--- a/searx/plugins/limiter.py
+++ b/searx/plugins/limiter.py
@@ -16,7 +16,7 @@ Enable the plugin in ``settings.yml``:
import re
from flask import request
-from searx.shared import redisdb
+from searx import redisdb
from searx.redislib import incr_sliding_window
name = "Request limiter"
diff --git a/searx/shared/redisdb.py b/searx/redisdb.py
index d8e29d911..0544d697f 100644
--- a/searx/shared/redisdb.py
+++ b/searx/redisdb.py
@@ -7,8 +7,8 @@
This implementation uses the :ref:`settings redis` setup from ``settings.yml``.
A redis DB connect can be tested by::
- >>> from searx.shared import redisdb
- >>> redisdb.init()
+ >>> from searx import redisdb
+ >>> redisdb.initialize()
True
>>> db = redisdb.client()
>>> db.set("foo", "bar")
@@ -30,7 +30,7 @@ OLD_REDIS_URL_DEFAULT_URL = 'unix:///usr/local/searxng-redis/run/redis.sock?db=0
"""This was the default Redis URL in settings.yml."""
_CLIENT = None
-logger = logging.getLogger('searx.shared.redisdb')
+logger = logging.getLogger(__name__)
def client() -> redis.Redis:
diff --git a/searx/search/checker/background.py b/searx/search/checker/background.py
index e5bd642c0..aec2a1790 100644
--- a/searx/search/checker/background.py
+++ b/searx/search/checker/background.py
@@ -14,7 +14,7 @@ from typing_extensions import TypedDict, Literal
import redis.exceptions
from searx import logger, settings, searx_debug
-from searx.shared.redisdb import client as get_redis_client
+from searx.redisdb import client as get_redis_client
from searx.exceptions import SearxSettingsException
from searx.search.processors import PROCESSORS
from searx.search.checker import Checker
diff --git a/searx/search/checker/scheduler.py b/searx/search/checker/scheduler.py
index 1ae635951..cc3bb7380 100644
--- a/searx/search/checker/scheduler.py
+++ b/searx/search/checker/scheduler.py
@@ -17,7 +17,7 @@ import time
import importlib
from typing import Callable
-from searx.shared.redisdb import client as get_redis_client
+from searx.redisdb import client as get_redis_client
from searx.redislib import lua_script_storage
diff --git a/searx/shared/__init__.py b/searx/shared/__init__.py
deleted file mode 100644
index 2c7fc9f8b..000000000
--- a/searx/shared/__init__.py
+++ /dev/null
@@ -1,6 +0,0 @@
-# SPDX-License-Identifier: AGPL-3.0-or-later
-# lint: pylint
-"""Initialization of a *shared* storage.
-"""
-
-from . import redisdb
diff --git a/searx/webapp.py b/searx/webapp.py
index 4f334a9d0..d4206ca16 100755
--- a/searx/webapp.py
+++ b/searx/webapp.py
@@ -120,7 +120,7 @@ from searx.locales import (
# renaming names from searx imports ...
from searx.autocomplete import search_autocomplete, backends as autocomplete_backends
from searx.languages import language_codes as languages
-from searx.shared.redisdb import initialize as redis_initialize
+from searx.redisdb import initialize as redis_initialize
from searx.search import SearchWithPlugins, initialize as search_initialize
from searx.network import stream as http_stream, set_context_network_name
from searx.search.checker import get_result as checker_get_result