fixed-topicstat-erorrs

This commit is contained in:
2022-09-14 16:02:05 +03:00
parent 1fc46bb450
commit a585f2a8e0
2 changed files with 20 additions and 11 deletions

View File

@@ -38,8 +38,8 @@ class ShoutsCache:
select(Shout)
.options(selectinload(Shout.authors), selectinload(Shout.topics))
.where(bool(Shout.publishedAt))
.group_by(Shout.slug)
.order_by(desc("publishedAt"))
.order_by(desc("createdAt"))
.limit(ShoutsCache.limit)
))
async with ShoutsCache.lock:
@@ -52,6 +52,8 @@ class ShoutsCache:
shouts = await prepare_shouts(session, (
select(Shout)
.options(selectinload(Shout.authors), selectinload(Shout.topics))
.where(and_(bool(Shout.publishedAt), bool(Reaction.deletedAt)))
.group_by(Shout.slug)
.order_by(desc("createdAt"))
.limit(ShoutsCache.limit)
))