Skip to content

Commit

Permalink
Merge branch 'hotfix/2025-01-23_es_background_job_fixes'
Browse files Browse the repository at this point in the history
  • Loading branch information
Steven-Eardley committed Jan 24, 2025
2 parents b4a3efc + f4f56ce commit dc04834
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion portality/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ def create_es_connection(app):

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))
timeout=app.config.get('ELASTICSEARCH_REQ_TIMEOUT', 15))

return conn

Expand Down
2 changes: 1 addition & 1 deletion portality/lib/es_snapshot.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def list_snapshots(self):

# If the client doesn't have the snapshots, ask ES for them
if not self.snapshots:
resp = self.conn.snapshot.get(self.repo, '_all', master_timeout='600s')
resp = self.conn.snapshot.get(self.repo, '_all', master_timeout='600s', request_timeout=60)

if 'snapshots' in resp:
try:
Expand Down
3 changes: 0 additions & 3 deletions portality/lib/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,6 @@ def load_function(fnpath, cache_fn_ref=True):
if fn is not None:
return fn

if isinstance(fnpath, str):
print(type(fnpath))

fn = load_function_raw(fnpath)
if fn is None:
app.logger.info("Could not load function {x}".format(x=fnpath))
Expand Down
2 changes: 1 addition & 1 deletion portality/tasks/request_es_backup.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def run(self):
resp, success = client.request_snapshot()
if success:
job = self.background_job
job.add_audit_message("ElasticSearch backup requested. Response: " + resp)
job.add_audit_message("ElasticSearch backup requested. Response: " + str(resp))
else:
raise Exception("Exception {0} received from snapshots plugin.".format(resp))

Expand Down

0 comments on commit dc04834

Please sign in to comment.