From c456807446e542bf597ac56cf28fe2a03e44d2bf Mon Sep 17 00:00:00 2001 From: Alex Garel Date: Wed, 26 Feb 2025 18:33:55 +0100 Subject: [PATCH] fix: larger timeout on logo search --- robotoff/logos.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/robotoff/logos.py b/robotoff/logos.py index c0f50718b5..09ac2c677e 100644 --- a/robotoff/logos.py +++ b/robotoff/logos.py @@ -239,7 +239,12 @@ def knn_search( knn_body["filter"] = {"term": {"server_type": server_type.name}} results = client.search( - index=ElasticSearchIndex.logo, knn=knn_body, source=False, size=k + 1 + index=ElasticSearchIndex.logo, + knn=knn_body, + source=False, + size=k + 1, + # this can be a long request + timeout=20, ) if hits := results["hits"]["hits"]: return [(int(hit["_id"]), 1.0 - hit["_score"]) for hit in hits]