From fb014f2b1bc55d49f0def62bcc264a561372bd25 Mon Sep 17 00:00:00 2001 From: Alberto Islas Date: Thu, 17 Oct 2024 13:57:58 -0600 Subject: [PATCH] fix(search): Removed ceil method since query_time is always an int --- cl/lib/search_utils.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/cl/lib/search_utils.py b/cl/lib/search_utils.py index 658bcab630..4d95ffa57e 100644 --- a/cl/lib/search_utils.py +++ b/cl/lib/search_utils.py @@ -1,6 +1,5 @@ import re from datetime import date, datetime, timedelta -from math import ceil from typing import Any, Dict, List, Optional, Tuple, Union, cast from urllib.parse import parse_qs, urlencode @@ -1229,15 +1228,15 @@ def store_search_query(request: HttpRequest, search_results: dict) -> None: return if is_es_search: - search_query.query_time_ms = ceil(search_results["results_details"][0]) + search_query.query_time_ms = search_results["results_details"][0] # do_es_search returns 1 as query time if the micro cache was hit search_query.hit_cache = search_query.query_time_ms == 1 else: # Solr searches are not cached unless a cache_key is passed # No cache_key is passed for the endpoints we are storing - search_query.query_time_ms = ceil( - search_results["results"].object_list.QTime - ) + search_query.query_time_ms = search_results[ + "results" + ].object_list.QTime search_query.save()