TransportError not raised in helpers.streaming_bulk() with max_retries. (#775)
* Add test to raise `TransportError` in `helpers.streaming_bulk()` with `max_retries`. * Re-raise `TransportError` if the last retry fails.
This commit is contained in:
@@ -210,7 +210,7 @@ def streaming_bulk(client, actions, chunk_size=500, max_chunk_bytes=100 * 1024 *
|
||||
|
||||
except TransportError as e:
|
||||
# suppress 429 errors since we will retry them
|
||||
if not max_retries or e.status_code != 429:
|
||||
if attempt == max_retries or e.status_code != 429:
|
||||
raise
|
||||
else:
|
||||
if not to_retry:
|
||||
|
||||
Reference in New Issue
Block a user