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):
|
async def get_topics_with_stat_cached(q):
|
||||||
try:
|
try:
|
||||||
records = []
|
records = []
|
||||||
|
current = None
|
||||||
with local_session() as session:
|
with local_session() as session:
|
||||||
for x in session.execute(q):
|
for x in session.execute(q):
|
||||||
|
current = x
|
||||||
stat_str = await redis.execute('GET', f'topic:{x.id}')
|
stat_str = await redis.execute('GET', f'topic:{x.id}')
|
||||||
if isinstance(stat_str, str):
|
if isinstance(stat_str, str):
|
||||||
x.stat = json.loads(stat_str).get('stat')
|
x.stat = json.loads(stat_str).get('stat')
|
||||||
records.append(x)
|
records.append(x)
|
||||||
except Exception as exc:
|
except Exception as exc:
|
||||||
|
logger.error(current)
|
||||||
raise Exception(exc)
|
raise Exception(exc)
|
||||||
return records
|
return records
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user