From 4a3cc9e5a9aa3af97fc55cc45c6e33f79dd89a25 Mon Sep 17 00:00:00 2001 From: Igor Chubin Date: Thu, 9 May 2019 22:17:45 +0200 Subject: [PATCH] lib/standalone.py disables cache --- lib/cache.py | 4 ++-- lib/standalone.py | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/cache.py b/lib/cache.py index 8a6d00c..1cc0323 100644 --- a/lib/cache.py +++ b/lib/cache.py @@ -36,7 +36,7 @@ def put(key, value): if _REDIS_PREFIX: key = _REDIS_PREFIX + key - if _REDIS: + if CONFIG["cache.type"] == "redis" and _REDIS: if isinstance(value, (dict, list)): value = json.dumps(value) @@ -50,7 +50,7 @@ def get(key): if _REDIS_PREFIX: key = _REDIS_PREFIX + key - if _REDIS: + if CONFIG["cache.type"] == "redis" and _REDIS: value = _REDIS.get(key) try: value = json.loads(value) diff --git a/lib/standalone.py b/lib/standalone.py index ba9691f..13066ca 100644 --- a/lib/standalone.py +++ b/lib/standalone.py @@ -43,6 +43,7 @@ def main(args): standalone wrapper for cheat_wrapper() """ + config.CONFIG["cache.type"] = "none" query, request_options = parse_cmdline(args) answer, _ = cheat_wrapper.cheat_wrapper(query, request_options=request_options) sys.stdout.write(answer.encode("utf-8"))