diff options
Diffstat (limited to 'searx/shared')
| -rw-r--r-- | searx/shared/__init__.py | 7 | ||||
| -rw-r--r-- | searx/shared/redisdb.py | 6 | ||||
| -rw-r--r-- | searx/shared/shared_uwsgi.py | 2 |
3 files changed, 11 insertions, 4 deletions
diff --git a/searx/shared/__init__.py b/searx/shared/__init__.py index 98c9a11c2..d10ddb33d 100644 --- a/searx/shared/__init__.py +++ b/searx/shared/__init__.py @@ -1,11 +1,14 @@ # SPDX-License-Identifier: AGPL-3.0-or-later import logging +import importlib logger = logging.getLogger('searx.shared') +__all__ = ['SharedDict', 'schedule'] + try: - import uwsgi + uwsgi = importlib.import_module('uwsgi') except: # no uwsgi from .shared_simple import SimpleSharedDict as SharedDict, schedule @@ -20,7 +23,7 @@ else: # uwsgi.ini configuration problem: disable all scheduling logger.error( 'uwsgi.ini configuration error, add this line to your uwsgi.ini\n' - 'cache2 = name=searxcache,items=2000,blocks=2000,blocksize=4096,bitmap=1' + 'cache2 = name=searxngcache,items=2000,blocks=2000,blocksize=4096,bitmap=1' ) from .shared_simple import SimpleSharedDict as SharedDict diff --git a/searx/shared/redisdb.py b/searx/shared/redisdb.py index da71d169c..bb7a0eeb4 100644 --- a/searx/shared/redisdb.py +++ b/searx/shared/redisdb.py @@ -19,10 +19,13 @@ A redis DB connect can be tested by:: """ +import os +import pwd import logging import redis from searx import get_setting + logger = logging.getLogger('searx.shared.redis') _client = None @@ -42,6 +45,7 @@ def init(): logger.info("connected redis DB --> %s", c.acl_whoami()) return True except redis.exceptions.ConnectionError as exc: - logger.error("can't connet redis DB ...") + _pw = pwd.getpwuid(os.getuid()) + logger.error("[%s (%s)] can't connect redis DB ...", _pw.pw_name, _pw.pw_uid) logger.error(" %s", exc) return False diff --git a/searx/shared/shared_uwsgi.py b/searx/shared/shared_uwsgi.py index 4a6b0a155..0248c6234 100644 --- a/searx/shared/shared_uwsgi.py +++ b/searx/shared/shared_uwsgi.py @@ -2,7 +2,7 @@ import time from typing import Optional -import uwsgi # pylint: disable=E0401 +import uwsgi # pyright: ignore # pylint: disable=E0401 from . import shared_abstract |