Skip to content

Commit

Permalink
Merge tag '2024-04-26_3868_extend_timeout_article_sync' into develop
Browse files Browse the repository at this point in the history
Increase ES req timeout
  • Loading branch information
Steven-Eardley committed Apr 26, 2024
2 parents 6dd2ed5 + 9e00f52 commit ddd6a87
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 14 deletions.
16 changes: 4 additions & 12 deletions portality/core.py
Expand Up @@ -166,18 +166,10 @@ def load_crossref_schema(app):

def create_es_connection(app):
# ~~ElasticConnection:Framework->Elasticsearch:Technology~~
# temporary logging config for debugging index-per-type
#import logging
#esprit.raw.configure_logging(logging.DEBUG)

# FIXME: we are removing esprit conn in favour of elasticsearch lib
# make a connection to the index
# if app.config['ELASTIC_SEARCH_INDEX_PER_TYPE']:
# conn = esprit.raw.Connection(host=app.config['ELASTIC_SEARCH_HOST'], index='')
# else:
# conn = esprit.raw.Connection(app.config['ELASTIC_SEARCH_HOST'], app.config['ELASTIC_SEARCH_DB'])

conn = elasticsearch.Elasticsearch(app.config['ELASTICSEARCH_HOSTS'], verify_certs=app.config.get("ELASTIC_SEARCH_VERIFY_CERTS", True))

conn = elasticsearch.Elasticsearch(app.config['ELASTICSEARCH_HOSTS'],
verify_certs=app.config.get("ELASTIC_SEARCH_VERIFY_CERTS", True),
request_timeout=app.config.get('ELASTICSEARCH_REQ_TIMEOUT', 15))

return conn

Expand Down
4 changes: 2 additions & 2 deletions portality/settings.py
Expand Up @@ -72,8 +72,8 @@
ELASTIC_SEARCH_SNAPSHOT_TTL = 366

ES_TERMS_LIMIT = 1024

ES_READ_TIMEOUT = '2m'
ELASTICSEARCH_REQ_TIMEOUT = 20 # Seconds - used in core.py for whole ES connection request timeout
ES_READ_TIMEOUT = '2m' # Minutes - used in DAO for searches

#####################################################
# Elastic APM config (MUST be configured in env file)
Expand Down

0 comments on commit ddd6a87

Please sign in to comment.