paginated topics and authors

This commit is contained in:
2022-08-30 09:42:51 +03:00
parent c15f2578b7
commit e4542ec5ca
4 changed files with 11 additions and 6 deletions

View File

@@ -27,10 +27,12 @@ class TopicStorage:
return topic
@staticmethod
async def get_topics_all():
async def get_topics_all(page, size):
end = page * size
start = end - size
self = TopicStorage
async with self.lock:
return self.topics.values()
return self.topics.values()[start:end]
@staticmethod
async def get_topics_by_slugs(slugs):