stat-fix
All checks were successful
Deploy on push / deploy (push) Successful in 23s

This commit is contained in:
Untone 2024-03-28 19:14:39 +03:00
parent 2d538a292a
commit a4957ef0ad

View File

@ -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)