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:
+2
-2
@@ -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)
|
||||
|
||||
@@ -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"))
|
||||
|
||||
Reference in New Issue
Block a user