topviewed-removed-queries-fixes
This commit is contained in:
@@ -52,7 +52,6 @@ from resolvers.zine import (
|
||||
recent_all,
|
||||
recent_commented,
|
||||
recent_reacted,
|
||||
top_viewed,
|
||||
shouts_by_authors,
|
||||
shouts_by_topics,
|
||||
shouts_by_communities,
|
||||
@@ -84,7 +83,6 @@ __all__ = [
|
||||
"get_user_reacted_shouts",
|
||||
"top_month",
|
||||
"top_overall",
|
||||
"top_viewed",
|
||||
"increment_view",
|
||||
"get_shout_by_slug",
|
||||
# editor
|
||||
|
@@ -18,16 +18,11 @@ from services.zine.shoutscache import ShoutsCache
|
||||
|
||||
@mutation.field("incrementView")
|
||||
async def increment_view(_, _info, shout):
|
||||
# TODO: use ackee to collect views
|
||||
async with ViewedStorage.lock:
|
||||
return ViewedStorage.increment(shout)
|
||||
|
||||
|
||||
@query.field("topViewed")
|
||||
async def top_viewed(_, _info, offset, limit):
|
||||
async with ShoutsCache.lock:
|
||||
return ShoutsCache.top_viewed[offset : offset + limit]
|
||||
|
||||
|
||||
@query.field("topMonth")
|
||||
async def top_month(_, _info, offset, limit):
|
||||
async with ShoutsCache.lock:
|
||||
|
Reference in New Issue
Block a user