mirror of
https://github.com/searxng/searxng.git
synced 2025-08-03 02:22:22 +02:00
move searx.shared.redisdb to searx.redisdb
This commit is contained in:
parent
34e260f88f
commit
b971167ced
12 changed files with 16 additions and 24 deletions
|
@ -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"
|
||||
|
|
|
@ -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:
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
||||
|
|
|
@ -1,6 +0,0 @@
|
|||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
# lint: pylint
|
||||
"""Initialization of a *shared* storage.
|
||||
"""
|
||||
|
||||
from . import redisdb
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue