debug-topics
This commit is contained in:
parent
6064f0326a
commit
358cc86197
|
@ -216,13 +216,16 @@ async def get_authors_with_stat_cached(q):
|
|||
async def get_topics_with_stat_cached(q):
|
||||
try:
|
||||
records = []
|
||||
current = None
|
||||
with local_session() as session:
|
||||
for x in session.execute(q):
|
||||
current = x
|
||||
stat_str = await redis.execute('GET', f'topic:{x.id}')
|
||||
if isinstance(stat_str, str):
|
||||
x.stat = json.loads(stat_str).get('stat')
|
||||
records.append(x)
|
||||
except Exception as exc:
|
||||
logger.error(current)
|
||||
raise Exception(exc)
|
||||
return records
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user