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:
Milly
2018-04-24 11:35:54 -06:00
committed by Nick Lang
parent 0aac8c9dff
commit cd871244e0
2 changed files with 18 additions and 1 deletions
+1 -1
View File
@@ -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: