public async Task End(Exception ex = null) { if (ex != null) { return; } if (_pendingSize > 0) { // Index the pending docs var response = await _client.BulkAsync(_pendingDocs.Consistency(Elasticsearch.Net.Consistency.Quorum)); if (response.Errors) { throw new StorageException(response); } } }
public async Task End(Exception ex = null) { if (ex != null) { return; } if (_pendingSize > 0) { // Index the pending docs var response = await _client.BulkAsync(_pendingDocs.Consistency(Consistency.Quorum)).ConfigureAwait(false); if (response.Errors) { foreach (var item in response.ItemsWithErrors.Select(x => x.Id)) { MemCache.Evict(item); } throw new StorageException(response); } } }