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

This commit is contained in:
2024-03-28 19:45:21 +03:00
parent 1eeff25b4d
commit 495b296508
2 changed files with 6 additions and 4 deletions

View File

@@ -202,7 +202,7 @@ async def get_authors_with_stat_cached(q):
records = []
with local_session() as session:
for [x] in session.execute(q):
stat_str = await redis.execute('GET', f'author:{x.id if isinstance(x, Author) else x}')
stat_str = await redis.execute('GET', f'author:{x.id}')
x.stat = json.loads(stat_str).get('stat') if isinstance(stat_str, str) else {}
records.append(x)
except Exception as exc: