Read `value` by `key`, and deserialize it if needed
(key)
| 47 | |
| 48 | |
| 49 | def get(key): |
| 50 | """ |
| 51 | Read `value` by `key`, and deserialize it if needed |
| 52 | """ |
| 53 | |
| 54 | if _REDIS_PREFIX: |
| 55 | key = _REDIS_PREFIX + key |
| 56 | |
| 57 | if CONFIG["cache.type"] == "redis" and _REDIS: |
| 58 | value = _REDIS.get(key) |
| 59 | try: |
| 60 | value = json.loads(value) |
| 61 | except (ValueError, TypeError): |
| 62 | pass |
| 63 | return value |
| 64 | return None |
| 65 | |
| 66 | |
| 67 | def delete(key): |
nothing calls this directly
no outgoing calls
no test coverage detected