diff options
| author | Alexandre Flament <alex@al-f.net> | 2021-12-27 19:11:01 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-12-27 19:11:01 +0100 |
| commit | c6922ae7c5e53f695d5f5f8704b10b4e2815cda4 (patch) | |
| tree | 9c0456ad1a1d9d375311ccd8c9bd3eafd0779114 /searx/shared | |
| parent | 54bce130f9074c3d63009237b014c727a1443cc5 (diff) | |
| parent | d84226bf63757b1d4245ab26e9c081daf42389aa (diff) | |
Merge pull request #619 from dalf/apply-black
Apply black
Diffstat (limited to 'searx/shared')
| -rw-r--r-- | searx/shared/__init__.py | 9 | ||||
| -rw-r--r-- | searx/shared/shared_abstract.py | 1 | ||||
| -rw-r--r-- | searx/shared/shared_simple.py | 2 | ||||
| -rw-r--r-- | searx/shared/shared_uwsgi.py | 1 |
4 files changed, 8 insertions, 5 deletions
diff --git a/searx/shared/__init__.py b/searx/shared/__init__.py index cbe24d239..98c9a11c2 100644 --- a/searx/shared/__init__.py +++ b/searx/shared/__init__.py @@ -9,6 +9,7 @@ try: except: # no uwsgi from .shared_simple import SimpleSharedDict as SharedDict, schedule + logger.info('Use shared_simple implementation') else: try: @@ -17,15 +18,19 @@ else: raise Exception() except: # 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') + 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' + ) from .shared_simple import SimpleSharedDict as SharedDict def schedule(delay, func, *args): return False + else: # uwsgi from .shared_uwsgi import UwsgiCacheSharedDict as SharedDict, schedule + logger.info('Use shared_uwsgi implementation') storage = SharedDict() diff --git a/searx/shared/shared_abstract.py b/searx/shared/shared_abstract.py index b1c72aabe..b4b15bea6 100644 --- a/searx/shared/shared_abstract.py +++ b/searx/shared/shared_abstract.py @@ -3,7 +3,6 @@ from abc import ABC, abstractmethod class SharedDict(ABC): - @abstractmethod def get_int(self, key): pass diff --git a/searx/shared/shared_simple.py b/searx/shared/shared_simple.py index 48d8cb822..0bf13a2a6 100644 --- a/searx/shared/shared_simple.py +++ b/searx/shared/shared_simple.py @@ -7,7 +7,7 @@ from . import shared_abstract class SimpleSharedDict(shared_abstract.SharedDict): - __slots__ = 'd', + __slots__ = ('d',) def __init__(self): self.d = {} diff --git a/searx/shared/shared_uwsgi.py b/searx/shared/shared_uwsgi.py index a6dba9f59..592e24a4b 100644 --- a/searx/shared/shared_uwsgi.py +++ b/searx/shared/shared_uwsgi.py @@ -9,7 +9,6 @@ _last_signal = 10 class UwsgiCacheSharedDict(shared_abstract.SharedDict): - def get_int(self, key): value = uwsgi.cache_get(key) if value is None: |