This commit is contained in:
parent
c46f264c4b
commit
5caa2d1f8c
|
@ -308,12 +308,12 @@ async def get_author_followers(_, _info, slug: str):
|
||||||
author_id = author.id
|
author_id = author.id
|
||||||
cached = await redis.execute("GET", f"author:{author_id}:followers")
|
cached = await redis.execute("GET", f"author:{author_id}:followers")
|
||||||
if cached:
|
if cached:
|
||||||
logger.debug(f"@{slug} got followers cached")
|
|
||||||
followers_ids = []
|
followers_ids = []
|
||||||
followers = []
|
followers = []
|
||||||
if isinstance(cached, str):
|
if isinstance(cached, str):
|
||||||
followers_cached = json.loads(cached)
|
followers_cached = json.loads(cached)
|
||||||
if isinstance(followers_cached, list):
|
if isinstance(followers_cached, list):
|
||||||
|
logger.debug(f"@{slug} got {len(followers_cached)} followers cached")
|
||||||
for fc in followers_cached:
|
for fc in followers_cached:
|
||||||
if fc['id'] not in followers_ids:
|
if fc['id'] not in followers_ids:
|
||||||
followers.append(fc)
|
followers.append(fc)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user