We tried using async_bulk
and async_streaming_bulk
helpers to ingest data into Elasticsearch and they work great, but we've found out that they prevent our code from gracefully shutting down when CTRL+C is pressed.
Example code that sleeps:
|
await asyncio.sleep( |
|
min(max_backoff, initial_backoff * 2 ** (attempt - 1)) |
|
) |
It would be great to have a way to:
- Either define how the sleep happens by passing sleep function into the client
- Make Elasticsearch client internally cancel all sleeps when the client is closed