From ed8961c7bfe8fcf623b293d021b617a63920a076 Mon Sep 17 00:00:00 2001 From: zsloan Date: Tue, 8 Sep 2020 13:40:02 -0500 Subject: Search code now checks if there are more than 50,000 results before running the code that queries the DB for max LRS locus information (which is what takes the most time to run) and sets a variable that indicates to the template (search_results.html) that it shouldn't show the results * wqflask/wqflask/search_results.py - Check number of results from base query in order to prevent certain searches from running too long --- wqflask/wqflask/search_results.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'wqflask') diff --git a/wqflask/wqflask/search_results.py b/wqflask/wqflask/search_results.py index de4b01eb..f63a84d1 100644 --- a/wqflask/wqflask/search_results.py +++ b/wqflask/wqflask/search_results.py @@ -79,8 +79,14 @@ views.py). self.search() except: self.search_term_exists = False + + self.too_many_results = False if self.search_term_exists: - self.gen_search_result() + if len(self.results) > 50000: + self.trait_list = [] + self.too_many_results = True + else: + self.gen_search_result() def gen_search_result(self): -- cgit v1.2.3