From 7e1ed79939ed851ef9aae36c201c514131b92650 Mon Sep 17 00:00:00 2001
From: Gandalf <gandalf@hive.io>
Date: Tue, 30 Jun 2020 16:10:02 -0400
Subject: [PATCH] [JES] Add a limit on the get_discussion call to only return
 at most 2000 posts/comments. There are some posts with thousands of children,
 and requesting those posts tends to cause the hivemind server to hang while
 executing a large query. This should prevent that

---
 hive/server/bridge_api/thread.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/hive/server/bridge_api/thread.py b/hive/server/bridge_api/thread.py
index 532a250e7..d73358d02 100644
--- a/hive/server/bridge_api/thread.py
+++ b/hive/server/bridge_api/thread.py
@@ -45,6 +45,7 @@ async def get_discussion(context, author, permlink, observer=None):
                             INNER JOIN hive_post_data hpd ON hpd.id = hive_posts.id
                             INNER JOIN hive_category_data hcd ON hcd.id = hp.category_id
                             WHERE NOT hive_posts.is_deleted AND NOT hive_posts.is_muted
+        LIMIT 2000
     """
 
     blacklists_for_user = None
-- 
GitLab