From 9d5608d72e61e343ef12cb1c9e14a7fb07cd1ec0 Mon Sep 17 00:00:00 2001 From: checktheroads Date: Sat, 15 Jun 2019 12:51:03 -0700 Subject: [PATCH] various minor changes to make pylint STFU --- .pylintrc | 6 +++++- hyperglass/gunicorn_config.py.example | 1 + hyperglass/hyperglass.py | 4 ++-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.pylintrc b/.pylintrc index 97f5d55..494e67f 100644 --- a/.pylintrc +++ b/.pylintrc @@ -16,6 +16,9 @@ # I find this to be needlessly obtuse, and therefore log fstrings directly: # logger.error(f"Error: {var1}, {var2}, {var3}") # Perhaps this is "incorrect", but it works well and is more elegant, in my uneducated opinion. +# +# "duplicate-code" was disabled due to PyLint complaining about using the same logzero debug +# configuration in two files. Apparently having a consistent logging configuration is "bad". [MASTER] @@ -154,7 +157,8 @@ disable=print-statement, comprehension-escape, bad-continuation, cyclic-import, - logging-fstring-interpolation + logging-fstring-interpolation, + duplicate-code # Enable the message, report, category or checker with the given id(s). You can # either give multiple identifier separated by comma (,) or put this option diff --git a/hyperglass/gunicorn_config.py.example b/hyperglass/gunicorn_config.py.example index cb69b08..14571d4 100644 --- a/hyperglass/gunicorn_config.py.example +++ b/hyperglass/gunicorn_config.py.example @@ -66,5 +66,6 @@ def worker_exit(server, worker): # pylint: disable=unused-argument def on_exit(server): + """Pre-shutdown Gunicorn Tasks""" if os.path.exists(prometheus_multiproc_dir): shutil.rmtree(prometheus_multiproc_dir) diff --git a/hyperglass/hyperglass.py b/hyperglass/hyperglass.py index 01e133e..7cd03c1 100644 --- a/hyperglass/hyperglass.py +++ b/hyperglass/hyperglass.py @@ -127,10 +127,10 @@ def handle_500(e): def clear_cache(): - """Function to clear the Flask-Caching cache""" + """Function to clear the Redis cache""" with app.app_context(): try: - cache.clear() + r_cache.flushdb() except Exception as error_exception: logger.error(f"Error clearing cache: {error_exception}") raise