offset-limit

This commit is contained in:
2022-09-14 14:09:28 +03:00
parent 66cd20514e
commit 1fc46bb450
3 changed files with 5 additions and 4 deletions

View File

@@ -39,6 +39,7 @@ class ShoutsCache:
.options(selectinload(Shout.authors), selectinload(Shout.topics))
.where(bool(Shout.publishedAt))
.order_by(desc("publishedAt"))
.order_by(desc("createdAt"))
.limit(ShoutsCache.limit)
))
async with ShoutsCache.lock: