diff --git a/services/cache.py b/services/cache.py index a33bc2c4..c8140ce0 100644 --- a/services/cache.py +++ b/services/cache.py @@ -28,7 +28,7 @@ async def cache_author(author: dict): author_id = author.get("id") user_id = author.get("user") payload = json.dumps(author, cls=CustomJSONEncoder) - await redis.execute("SET", f"user:id:{user_id}", author_id) + await redis.execute("SET", f"author:user:{user_id}", author_id) await redis.execute("SET", f"author:id:{author_id}", payload) @@ -74,7 +74,7 @@ async def get_cached_author(author_id: int, get_with_stat): async def get_cached_author_by_user_id(user_id: str, get_with_stat): - author_id = await redis.execute("GET", f"user:id:{user_id}") + author_id = await redis.execute("GET", f"author:user:{user_id}") if author_id: return await get_cached_author(int(author_id), get_with_stat)