diff --git a/resolvers/stat.py b/resolvers/stat.py index ea707769..671f796c 100644 --- a/resolvers/stat.py +++ b/resolvers/stat.py @@ -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