work-load-fixes
This commit is contained in:
@@ -244,6 +244,16 @@ class ShoutsCache:
|
||||
print("[zine.cache] indexed by %d authors " % len(shouts_by_author.keys()))
|
||||
ShoutsCache.by_author = shouts_by_author
|
||||
|
||||
@staticmethod
|
||||
async def get_by_author(author):
|
||||
async with ShoutsCache.lock:
|
||||
return ShoutsCache.by_author.get(author, [])
|
||||
|
||||
@staticmethod
|
||||
async def get_by_topic(topic):
|
||||
async with ShoutsCache.lock:
|
||||
return ShoutsCache.by_topic.get(topic, [])
|
||||
|
||||
@staticmethod
|
||||
async def get_top_published_before(daysago, offset, limit):
|
||||
shouts_by_rating = []
|
||||
|
Reference in New Issue
Block a user