Fix annotating results and remove debugging code

This commit is contained in:
2022-11-23 18:39:36 +00:00
parent c49c8898eb
commit 1bdd332e6e
4 changed files with 10 additions and 17 deletions

View File

@@ -267,8 +267,6 @@ class StorageBackend(ABC):
cache_hit = r.get(f"query_cache.{user.id}.{hash}")
if cache_hit:
response = orjson.loads(cache_hit)
print("CACHE HIT", response)
time_took = (time.process_time() - start) * 1000
# Round to 3 significant figures
time_took_rounded = round(
@@ -301,8 +299,6 @@ class StorageBackend(ABC):
return context
else:
return response
# response = response.to_dict()
# print("RESP", response)
if "took" in response:
if response["took"] is None:
return None
@@ -331,7 +327,7 @@ class StorageBackend(ABC):
def process_results(self, response, **kwargs):
if kwargs.get("annotate"):
annotate_results(response)
if kwargs.get("dedup"):
if kwargs.get("reverse"):
response = response[::-1]
if kwargs.get("dedup"):
if not kwargs.get("dedup_fields"):