aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@archive.org>2022-02-14 11:21:24 -0800
committerBryan Newbold <bnewbold@archive.org>2022-02-14 11:21:27 -0800
commit1ca8ae466b3e1060ba1dfb9eef97f8d5341286fb (patch)
tree3b80542ab1d2fd758b3f5811ba4e270e3e5cb858
parent2fa67e275433e98556706b32d33db93e270c051c (diff)
downloadfatcat-scholar-1ca8ae466b3e1060ba1dfb9eef97f8d5341286fb.tar.gz
fatcat-scholar-1ca8ae466b3e1060ba1dfb9eef97f8d5341286fb.zip
increase ES default timeout to 50sec, and _health specifically to 90sec
This is because we are getting lots of alert chunder on the health check. It might be better to revisit which endpoint is being checked... 'count' is usually fast, but might be slow during bulk indexing.
-rw-r--r--fatcat_scholar/search.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/fatcat_scholar/search.py b/fatcat_scholar/search.py
index bb0b155..5cf916c 100644
--- a/fatcat_scholar/search.py
+++ b/fatcat_scholar/search.py
@@ -100,7 +100,7 @@ class FulltextHits(BaseModel):
# global sync client connection
-es_client = elasticsearch.Elasticsearch(settings.ELASTICSEARCH_QUERY_BASE, timeout=40.0)
+es_client = elasticsearch.Elasticsearch(settings.ELASTICSEARCH_QUERY_BASE, timeout=50.0)
def transform_es_results(resp: Response) -> List[dict]:
@@ -464,7 +464,9 @@ def es_scholar_index_alive() -> bool:
"""
try:
resp = es_client.count(
- body=None, index=settings.ELASTICSEARCH_QUERY_FULLTEXT_INDEX
+ body=None,
+ index=settings.ELASTICSEARCH_QUERY_FULLTEXT_INDEX,
+ timeout=90.0,
)
except elasticsearch.exceptions.RequestError as e_raw:
if e_raw.status_code == 404: