diff options
author | Markus Heiser <markus.heiser@darmarit.de> | 2021-05-05 16:47:02 +0200 |
---|---|---|
committer | Markus Heiser <markus.heiser@darmarit.de> | 2021-05-05 16:47:02 +0200 |
commit | fa0d05c3131041eb44542e0b505eaed1833bf86e (patch) | |
tree | 50002f4c1c31d7e93897b70bc8a8aac946df0b6a /searx | |
parent | 8c1a65d32fb6a0859c0052d668d01f08325f11ad (diff) | |
download | searxng-fa0d05c3131041eb44542e0b505eaed1833bf86e.tar.gz searxng-fa0d05c3131041eb44542e0b505eaed1833bf86e.zip |
[pylint] checker/__main__.py & checker/background.py
Lint files that has been touched by [PR #58]
[PR #58] https://github.com/searxng/searxng/pull/58
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Diffstat (limited to 'searx')
-rw-r--r-- | searx/search/checker/__main__.py | 2 | ||||
-rw-r--r-- | searx/search/checker/background.py | 10 |
2 files changed, 8 insertions, 4 deletions
diff --git a/searx/search/checker/__main__.py b/searx/search/checker/__main__.py index 7f6de8f8b..7a85347cc 100644 --- a/searx/search/checker/__main__.py +++ b/searx/search/checker/__main__.py @@ -1,4 +1,6 @@ # SPDX-License-Identifier: AGPL-3.0-or-later +# lint: pylint +# pylint: disable=missing-module-docstring, missing-function-docstring import sys import io diff --git a/searx/search/checker/background.py b/searx/search/checker/background.py index 276426fa7..4c2750b44 100644 --- a/searx/search/checker/background.py +++ b/searx/search/checker/background.py @@ -1,4 +1,6 @@ # SPDX-License-Identifier: AGPL-3.0-or-later +# lint: pylint +# pylint: disable=missing-module-docstring, missing-function-docstring import json import random @@ -34,7 +36,7 @@ def _get_every(): return _get_interval(every, 'checker.scheduling.every is not a int or list') -def get_result(): +def get_result(): # pylint: disable=inconsistent-return-statements serialized_result = storage.get_str(CHECKER_RESULT) if serialized_result is not None: return json.loads(serialized_result) @@ -47,7 +49,7 @@ def _set_result(result, include_timestamp=True): def run(): - if not running.acquire(blocking=False): + if not running.acquire(blocking=False): # pylint: disable=consider-using-with return try: logger.info('Starting checker') @@ -66,7 +68,7 @@ def run(): _set_result(result) logger.info('Check done') - except Exception: + except Exception: # pylint: disable=broad-except _set_result({'status': 'error'}) logger.exception('Error while running the checker') finally: @@ -87,7 +89,7 @@ def _start_scheduling(): run() -def _signal_handler(signum, frame): +def _signal_handler(_signum, _frame): t = threading.Thread(target=run) t.daemon = True t.start() |