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

fix(deployer): stream bulk actions to avoid rate limit #12411

Merged
merged 4 commits into from
Jan 8, 2025
Merged
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 deployer/src/deployer/search/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from collections import Counter

import click
from elasticsearch.helpers import parallel_bulk
from elasticsearch.helpers import streaming_bulk
from elasticsearch_dsl import Index
from elasticsearch_dsl.connections import connections
from selectolax.parser import HTMLParser
Expand Down Expand Up @@ -90,7 +90,7 @@ def get_progressbar():
errors_counter = Counter()
t0 = time.time()
with get_progressbar() as bar:
for success, info in parallel_bulk(
for success, info in streaming_bulk(
connection,
generator(),
# If the bulk indexing failed, it will by default raise a BulkIndexError.
Expand Down
Loading