1
0
mirror of https://github.com/chubin/cheat.sh.git synced 2026-06-20 13:16:44 +02:00

lib/standalone.py disables cache

This commit is contained in:
Igor Chubin
2019-05-09 22:17:45 +02:00
parent 5ec6202bfb
commit 4a3cc9e5a9
2 changed files with 3 additions and 2 deletions
+2 -2
View File
@@ -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)
+1
View File
@@ -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"))