From bfdfa35bc90e05883069736ec38d276f58453c70 Mon Sep 17 00:00:00 2001 From: tonyrewin Date: Tue, 15 Nov 2022 18:20:44 +0300 Subject: [PATCH] fixes-wip --- schema.graphql | 2 ++ services/stat/views.py | 9 ++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/schema.graphql b/schema.graphql index 10f435da..73e8762b 100644 --- a/schema.graphql +++ b/schema.graphql @@ -216,6 +216,7 @@ input ShoutsBy { title: String body: String topic: String + topics: [String] author: String layout: String visibility: String @@ -226,6 +227,7 @@ input ShoutsBy { input ReactionBy { shout: String + shouts: [String] body: String topic: String author: String diff --git a/services/stat/views.py b/services/stat/views.py index 6d028483..3d79bc8e 100644 --- a/services/stat/views.py +++ b/services/stat/views.py @@ -51,11 +51,14 @@ class ViewStat: async with self.lock: self.by_topics = await redis.execute("GET", "views_by_topics") if self.by_topics: - self.by_topics = json.loads(self.by_topics) + self.by_topics = dict(json.loads(self.by_topics)) + else: + self.by_topics = {} self.by_slugs = await redis.execute("GET", "views_by_shouts") if self.by_slugs: - self.by_slugs = json.loads(self.by_slugs) - + self.by_slugs = dict(json.loads(self.by_slugs)) + else: + self.by_slugs = {} domains = await self.client.execute_async(query_ackee_views) print("[stat.ackee] loaded domains") print(domains)