This commit is contained in:
parent
2d538a292a
commit
a4957ef0ad
|
@ -197,14 +197,13 @@ def get_with_stat(q):
|
|||
|
||||
|
||||
async def get_authors_with_stat_cached(q):
|
||||
logger.debug(q)
|
||||
# logger.debug(q)
|
||||
try:
|
||||
records = []
|
||||
with local_session() as session:
|
||||
for [x] in session.execute(q):
|
||||
stat_str = await redis.execute('GET', f'author:{x.id}')
|
||||
if isinstance(stat_str, str):
|
||||
x.stat = json.loads(stat_str).get('stat')
|
||||
x.stat = json.loads(stat_str).get('stat') if isinstance(stat_str, str) else {}
|
||||
records.append(x)
|
||||
except Exception as exc:
|
||||
raise Exception(exc)
|
||||
|
|
Loading…
Reference in New Issue
Block a user