Save `value` with `key`, and serialize it if needed
(key, value)
| 32 | |
| 33 | |
| 34 | def put(key, value): |
| 35 | """ |
| 36 | Save `value` with `key`, and serialize it if needed |
| 37 | """ |
| 38 | |
| 39 | if _REDIS_PREFIX: |
| 40 | key = _REDIS_PREFIX + key |
| 41 | |
| 42 | if CONFIG["cache.type"] == "redis" and _REDIS: |
| 43 | if isinstance(value, (dict, list)): |
| 44 | value = json.dumps(value) |
| 45 | |
| 46 | _REDIS.set(key, value) |
| 47 | |
| 48 | |
| 49 | def get(key): |
nothing calls this directly
no outgoing calls
no test coverage detected