Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Print errors when reindexing papers #2024

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/search/management/commands/index_papers_in_es.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,13 @@ def index_papers_in_bulk(es, from_id, to_id, max_attempts=5):
) as e:
if attempt == max_attempts:
print(
f"Failed to index papers after {max_attempts} attempts due to persistent timeouts. Last ID attempted was {current_id}."
f"Failed to index papers after {max_attempts} attempts due to persistent timeouts. Last ID attempted was {current_id}: {e}"
)
return
else:
wait_time = 2**attempt # Exponential backoff
print(
f"Timeout encountered. Retrying batch starting at {current_id} in {wait_time} seconds (Attempt {attempt}/{max_attempts})..."
f"Timeout encountered: {e}. Retrying batch starting at {current_id} in {wait_time} seconds (Attempt {attempt}/{max_attempts})..."
)
time.sleep(wait_time)

Expand Down