Skip to content

Commit

Permalink
fix: larger timeout at index creation time
Browse files Browse the repository at this point in the history
  • Loading branch information
alexgarel committed Aug 23, 2024
1 parent 117624d commit a664fe9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -477,15 +477,16 @@ def run_items_import(
if True consider we don't have a full import,
and directly updates items in current index.
"""
es_client = connection.get_es_client()
# we need a large timeout as index creation can take a while because of synonyms
es_client = connection.get_es_client(request_timeout=600)
if not partial:
# we create a temporary index to import to
# at the end we will change alias to point to it
index_date = datetime.now().strftime("%Y-%m-%d-%H-%M-%S-%f")
next_index = f"{config.index.name}-{index_date}"
index = generate_index_object(next_index, config)
# create the index
index.save()
index.save(using=es_client)
else:
# use current index
next_index = config.index.name
Expand Down

0 comments on commit a664fe9

Please sign in to comment.