lib/embulk/input/elasticsearch/connection.rb in embulk-input-elasticsearch-nosslverify-0.3.6 vs lib/embulk/input/elasticsearch/connection.rb in embulk-input-elasticsearch-nosslverify-0.3.7

- old
+ new

@@ -12,10 +12,11 @@ @size = task['per_size'] @fields = task['fields'] @sort = task['sort'] @limit_size = task['limit_size'] @retry_on_failure = task['retry_on_failure'] + @ignore_not_found = task['ignore_not_found'] @client = create_client( nodes: task['nodes'], reload_connections: task['reload_connections'], reload_on_failure: task['reload_on_failure'], retry_on_failure: task['retry_on_failure'], @@ -65,9 +66,14 @@ def search_with_retry retries = 0 begin yield if block_given? + rescue Faraday::ResourceNotFound => e + if (@ignore_not_found) + return + + end rescue => e if (@retry_on_failure == 0 || retries < @retry_on_failure) retries += 1 Embulk.logger.warn "Could not search to Elasticsearch, resetting connection and trying again. #{e.message}" sleep 2**retries