This commit is contained in:
parent
1f012ae5c9
commit
1eeff25b4d
|
@ -202,7 +202,7 @@ async def get_authors_with_stat_cached(q):
|
||||||
records = []
|
records = []
|
||||||
with local_session() as session:
|
with local_session() as session:
|
||||||
for [x] in session.execute(q):
|
for [x] in session.execute(q):
|
||||||
stat_str = await redis.execute('GET', f'author:{x.id}')
|
stat_str = await redis.execute('GET', f'author:{x.id if isinstance(x, Author) else x}')
|
||||||
x.stat = json.loads(stat_str).get('stat') if isinstance(stat_str, str) else {}
|
x.stat = json.loads(stat_str).get('stat') if isinstance(stat_str, str) else {}
|
||||||
records.append(x)
|
records.append(x)
|
||||||
except Exception as exc:
|
except Exception as exc:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user