diff --git a/resolvers/zine.py b/resolvers/zine.py index 80208939..0680e05e 100644 --- a/resolvers/zine.py +++ b/resolvers/zine.py @@ -14,7 +14,7 @@ from resolvers.topics import topic_follow, topic_unfollow from services.stat.viewed import ViewedStorage from services.zine.shoutauthor import ShoutAuthorStorage from services.zine.shoutscache import ShoutsCache -from services.zine import SearchService +from services.search import SearchService @mutation.field("incrementView") diff --git a/services/search.py b/services/search.py index 6e03a853..89e6abce 100644 --- a/services/search.py +++ b/services/search.py @@ -7,13 +7,11 @@ class SearchService: cache = {} @staticmethod - def init(session): - self = SearchService - async with self.lock: - self.cache = {} + async def init(session): + async with SearchService.lock: + SearchService.cache = {} @staticmethod async def search(text) -> [Shout]: - self = SearchService - async with self.lock: + async with SearchService.lock: return [] # TODO: implement getting shouts list