diff --git a/cachepot/storages/redis.py b/cachepot/storages/redis.py index 663b0fc..3888f45 100644 --- a/cachepot/storages/redis.py +++ b/cachepot/storages/redis.py @@ -6,7 +6,7 @@ class RedisStorage(AbstractStorage): - def __init__(self, redis: Redis[bytes]): + def __init__(self, redis: 'Redis[bytes]'): assert isinstance(redis, Redis), 'Invalid Redis client passed' self.redis: Redis[bytes] = redis @@ -14,7 +14,7 @@ async def get(self, key: str) -> Optional[bytes]: data = await self.redis.get(key) if data and not isinstance(data, bytes): return bytes(data) - return None + return data async def set(self, key: str, value: bytes, expire: Optional[int] = None) -> bool: await self.redis.set(key, value, ex=expire)