This commit is contained in:
parent
d15b36a0f1
commit
f6b21174bf
|
@ -325,8 +325,7 @@ async def get_author_followers(_, _info, slug: str):
|
||||||
else:
|
else:
|
||||||
logger.debug(f"@{slug} got followers cached")
|
logger.debug(f"@{slug} got followers cached")
|
||||||
if isinstance(cached, str):
|
if isinstance(cached, str):
|
||||||
data = json.loads(cached)
|
return json.loads(cached)
|
||||||
return [dict(d) for d in set(tuple(d.items()) for d in data)]
|
|
||||||
except Exception as exc:
|
except Exception as exc:
|
||||||
import traceback
|
import traceback
|
||||||
|
|
||||||
|
|
|
@ -112,7 +112,10 @@ async def cache_follower(follower: dict, author: dict, is_insert=True):
|
||||||
else:
|
else:
|
||||||
followers = [e for e in followers if int(e["id"]) != author_id]
|
followers = [e for e in followers if int(e["id"]) != author_id]
|
||||||
|
|
||||||
followers = [dict(d) for d in set(tuple(d.items()) for d in followers)]
|
followers = [
|
||||||
|
dict(d)
|
||||||
|
for d in set(tuple(tuple(k, v) for k, v in d.items()) for d in followers)
|
||||||
|
]
|
||||||
|
|
||||||
author_str = await redis.execute("GET", f"author:{follower_id}")
|
author_str = await redis.execute("GET", f"author:{follower_id}")
|
||||||
if isinstance(author_str, str):
|
if isinstance(author_str, str):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user